Quiz #1 Review

Quiz is Wednesday June 1st


When I describe a command below, the bits in <> are required arguments and the bits in [] are optional arguments. For example, touch requires a path argument, rm has two optional arguments and requires a path, and su has one optional argument (just a '-') and an optional username argument. You should know the arguments I've listed and the general format of the command.

To make your life a bit easier, I've marked a few things which will be on the test with .

Secure Passwords

Six characters long, mix of case, numbers, letters, symbols

Environment Variables

'$' to access. For example:
    echo $PATH prints the contents of PATH
    touch $HOSTNAME creates a file named after your computer

'set' to list all environment variables

'export' to set a new variable. For example:
    export MYVAR=cs3040 sets the environment variable 'MYVAR' to contain 'cs3040'
    echo $MYVAR prints "cs3040"

What PATH and HOSTNAME contain and are used for.

Inline Command Execution

Use the back-tick `. For example:
    touch `pwd` updates the access time on the current directory
    ping `hostname` pings the local host

Unix commands

touch <path>
mkdir <path>
ls [-l, -a, -R] [path]
cd <path>
rm [-r, -f] <path>
rmdir <path>
who [ am i, -a]
ps [-e, -a]
netstat [-a]
uname [-a]
echo [string]
script [-a] [path]
groups [username]
chmod <permissions> <path>
chown <username> <path>
chgrp <groupname> <path>
head [-# where # is a decimal number] <path>
tail [-# where # is a decimal number, -f] <path>
more <path>
cat <path>
su [-] [username]

Unix Commands for Users and Groups

passwd [username]
useradd [-c,-d,-m,-s] <username>
userdel [-r] <username>
groupadd <groupname>
groupdel <groupname>
groups [username]

User and Group Files

/etc/passwd: Contains all user account information except the password
/etc/shadow: Contains user account passwords
/etc/group: Contains group account information and group membership information

Access Control Lists

getfacl <path>
setfacl [-m, -x] <entity_type>:<entity>:<permissions> For example:
    setfacl u:cartman:rwx /secret makes cartman a user on /secret with read, write, and execute privileges
    setfacl g:fourthgrade:x /secret makes fourthgrade a group on /secret with execute privileges

Unix Filesystems

General filesystem concept:
    Filesystem more abstract than Microsoft Windows
    Filesystems not associated with a hardware device (no C: or D:)
    Filesystems can be mounted anywhere
mount [<device> <path>] (Note: The device and path are both optional, but if you give a device you must give a path)
umount <path>
df [-h] [path]
fsck <device>

Virtual Memory

Swap partitions: What they are, why we have them.
free [-m,-k]
swapoff <device>
mkswap <file>
swapon <file>