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 a different) directory | cd DName |
| List contents of current directory | ls |
| List contents of a different directory | ls DName |
| List contents of a directory in detail | ls -l DName |
| Remove an empty directory | rmdir 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 ScriptName |
| End recording of script | Ctrl-d |
|
| Edit a file | emacs FName |
| Compile a single C++ program | make SourceName |
| Compile and link several C++ programs | g++ FName1.cpp ... FNamen.cpp -o ExecFName |
|
| Change your password | passwd |
| Exit the system | logout |