An alternative crib sheet is available (old but still useful).
|
|
Files and Directories | ||
---|---|---|
General Commands | ||
Command | Description | Example (% is a response from the operating system) |
pwd | print current (working) directory: it tells you what directory you are currently in | pwd % /home/cur/mlb |
cd | change directory |
cd subdirectory |
ls | list files in the current directory | ls |
ls -l | list files in the current directory: include file date and size | ls -l |
ls -l directoryName | list files in the named directory: include file date and size | ls -l /web/cs/docs |
ls -l fileName | list the named file only: include file date and size | ls -l /web/cs/docs/welcome.html |
Files | ||
cp | make a copy of a file | cp oldfile newfile cp olddir newdir |
mv | rename a file (move file) |
mv oldfile newfile |
rm | delete (remove) a file | rm filename |
chmod | to change the permissions (use with caution: see Unix manual page for help) | chmod g+w somefile.doc |
Directories | ||
mkdir | create a new directory (folder) | mkdir newdir |
mv | rename a file (move file) |
mv olddir newdir |
rmdir | delete (remove) an empty directory (one which contains no
files or directories): remove any files inside the directory first using rm |
rmdir dirname |
chmod | to change the permissions (use with caution: see Unix manual page for help) | chmod g+w somedirectory |
Miscellaneous | ||
pico | file editor on UNIX machines | pico filename |
vi | file editor on UNIX machines | vi filename |
pfe | file editor on Windows | |
notepad | file editor on Windows | |
wordpad | file editor on Windows |