| Description | Shortcut key |
| Directory listing | ls |
| List files in current directory using long format | ls -l |
| List all files in current directory in long format and display in columns | ls -laC |
| List files in current directory and indicate the file type | ls -F |
| Formatted listing with hidden files | ls -al |
| Change directory to dir | cd dir |
| Change to home | cd |
| Create a directory dir | mkdir dir |
| Show current directory | pwd |
| Remove a file or directory called name | rm name |
| Delete directory dir | rm -r dir |
| Force remove file | rm -f file |
| Force remove an entire directory dir and all it’s included files and subdirectories (use with extreme caution) | rm -rf dir |
| Copy file1 to file2 | cp file1 file2 |
| Copy dir1 to dir2; create dir2 if it doesn't exist | cp -r dir1 dir2 |
| Copy the filename called file to the /home/dirname directory | cp file /home/dirname |
| Move the file called filename to the /home/dirname directory | mv file /home/dirname |
| Rename or move file1 to file2; if file2 is an existing directory, moves file1 into directory file2 | mv file1 file2 |
| Create symbolic link link to file | ln -s file link |
| Create or update file | touch file |
| Places standard input into file | cat > file |
| Display the file called file | cat file |
| Display the file called file one page at a time, proceed to next page using the spacebar | more file |
| Output the first 10 lines of file | head file |
| Display the first 20 lines of the file called file | head -20 file |
| Output the last 10 lines of file | tail file |
| Display the last 20 lines of the file called file | tail -20 file |
| Output the contents of file as it grows, starting with the last 10 lines | tail -f file |
No comments:
Post a Comment