This page lists some frequently used UNIX commands. The symbols DName and FName stand for arbitrary directory and file names, respectively.
| Desired Action: | UNIX Command: |
|---|---|
| Get information about a UNIX command | man Command |
| Create a directory | mkdir DName |
| Change (to arbitrary) directory | cd DName |
| List contents of working directory | ls |
| List contents of arbitrary directory | ls DName |
| List contents of directory in deail | ls -l DName |
| List all (hidden) files in directory | ls -a DName |
| Remove an empty directory | rmdir DName |
| Remove a non-empty directory | rm -r DName |
| Remove a file | rm FName |
| Rename a file or directory | mv OldName NewName |
| Move a file into a different directory | mv FName DName |
| Copy a file | cp OriginalFName CopyFName |
| Copy a directory and all its subdirectories | cp -r OriginalDName CopyDName |
| Clear the screen/window | clear |
| Record what appears on the screen/window | script |
| Edit a file | emacs FName & |
| Translate a self-contained C++ program | g++ SourceFName -o ExecFName |
| (Separately) compile C++ program | g++ -c SourceFName |
| Link C++ object files | g++ FName1.o ... FNameN.o -o ExecFName |