Cheat Sheets

Command Line Cheat Sheet

Directory Operations

Command Uasge Description
pwd pwd print current working directory
mkdir mkdir dir make directory dir
cd cd dir Change directory to dir
cd cd .. Go up a directory
ls ls lists files and folders

File Operations

Command Uasge Description
touch touch file1 Create file1
cat cat file1 file2 Concatenate files and output
less less file1 View and paginate file1
file file file1 Get type of file1
cp cp file1 file2 Copy file1 to file2
mv mv file1 file2 Move file1 to file2
rm rm file1 Delete file1
head head file1 Show first 10 lines of file1
tail tail file1 Show last 10 lines of file1
tail -F tail -F file1 Output last lines of file1 as it changes

Process Management

Command Uasge Description
ps Show snapshot of processes
top Show real time processes
kill pid Kill process with id pid
pkill name Kill process with name name
killall name Kill all processes with names beginning name