UNIX Commands


Note: all paths can be absolute or relative (See lab 0 for details). Commands will be added to this page as necessary as the course progresses.
CommandPurposeUsage
pwd Find ones current location in the directory tree (Present Working Directory) pwd
ls View the contents of the current directory ls
ls -l - view a detailed listing of files
ls -a - view all files, even hidden files
ls -al - view a detailed listing of all files
cd Change directories cd <path>
cd or cd ~ - change to your home directory
mkdir Create directory mkdir <path to directory>
rmdir Delete a directory (The directory must be empty) rmdir <path to directory>
mv Move a file. Can be used to rename a file. mv <file> <path to new file>
mv <file> <new name>
cp Copy a file cp <file> <path to new location>
rm Remove a file. BE CAREFUL! There is no recycle bin in Unix. This cannot be undone. Make sure you want to do this if you do it. rm <file>
jar Compress/uncompress files. Creates a file if "compressed filename" does not exist. Compress file:
jar -cvf <compressed filename> <directory to encrypt>
Decompress file:
jar -xvf <compressed file>