UNIX Cheat Sheet
(adapted from Treebeard’s Unix Cheat Sheet, )
Help on any Unix command.
Type man ls to read the manual for the
man {command}
ls command.
Redirect help to a file to download.
man {command} > {filename}
List a directory
It's ok to combine attributes, eg ls -laF
ls {path}
gets a long listing of all files with types.
List both {path_1} and {path_2}.
ls {path_1} {path_2}
Long listing, with date, size and
ls -l {path}
permisions.
Show all files, including important .dot
ls -a {path}
files that don't otherwise show.
Show type of each file. "/" = directory,
ls -F {path}
"*" = executable.
Recursive listing, with all subdirs.
ls -R {path}
Redirect directory to a file.
ls {path} > {filename}
Show listing one screen at a time.
ls {path} | more
Change to directory
There must be a space between.
cd {dirname}
Go back to home directory, useful if
cd ~
you're lost.
Go back one directory.
cd ..
Make a new directory
mkdir {dirname}
Remove a directory
Only works if {dirname} is empty.
rmdir {dirname}
Remove all files and subdirs. Careful!
rm -r {dirname}
Print working directory
Show where you are as full path. Useful
pwd
if you're lost or exploring.
1