A Few Useful Unix Commands

1. Help Commands

man -k keywordList titles and descriptions of manual pages related to your keyword
man commandView the manual page for the given command.

2. File and Directory Manipulation

mv fromfile tofileMove or rename a file or directory
cp fromfile tofileCopy a file - like mv but fromfile is unchanged
rm filenameRemove (delete) a file.
mkdir dirnameMake a directory.
rmdir dirnameRemove an empty directory. rm -r removes a directory and everything in it.
ls fileLists a file or directory.
ls -l fileShows the attributes of the file specified.
ls Lists all the files in the current directory.
ls -l Shows attributes for all the files in the current directory.
cd dirnameChange to directory dirname.
cd Change to your home directory.
pwdPrint the name of your current directory. (Present Working Directory).
gunzip file Uncompress a .gz file.
tar xvf filename extract the components of a tarfile.

3. File Viewing and Editing

cat filenameQuick way to view a file.
more filenameLike cat, but does a whole lot more.
vi filenameStandard Unix full-screen editor.
emacs filenameAnother standard Unix editor.

4. File and Account Protection

passwdChange your password.
chmodChange the mode (access rights) of a file or directory.

5. Printing and Printer Control

lpr [-P printer] filenamePrint a file.
lpq [-P printer]Check the status of jobs on a printer.