Bash Cheat Sheet
List files
ls |
Lists all files in current directory -a show hidden files |
View files
cat |
Prints contents of the provided file, if multiple files are provided then concatenates the contents. $ cat file1.txt file2.txt |
head |
Peak first 10 lines of the given file. -n number of lines to peak. $ head -n 5 file.txt |
tail |
Peak last 10 lines of the given file. -n number of lines to peak. $ tail -n 5 file.txt |
Delete files/folders
rm |
Deletes files -r (recursive) to delete folder $ rm -r temp_folder |
Media
[](https://youtu.be/vt5fpE0bzSY) |
Link to video |
 |
Embed image |
Escape characters
\ |
Use backspace before the special character to escape and they appear as literal characters. |