Deletes a folder and its contents. Double-check the path
Read and search
Command
What it does
cat <file>
Prints a file
less <file>
Scrolls through a file (press q to quit)
head -n 20 <file>
Shows the first 20 lines
tail -f <file>
Follows new lines as they are written
grep "text" <file>
Finds lines that contain text
grep -r "text" .
Searches every file in the folder
find . -name "*.png"
Finds files by name
Permissions
Command
What it does
chmod 644 <file>
Sets permissions by number
chmod +x <file>
Makes a file executable
chown user:group <file>
Changes the owner
sudo <command>
Runs a command as an administrator
Processes and system
Command
What it does
ps aux
Lists running processes
top
Live view of resource use
kill <pid>
Asks a process to stop
df -h
Shows disk space
du -sh <folder>
Shows a folder’s size
Network
Command
What it does
ping <host>
Tests whether a host responds
curl <url>
Fetches a URL
ssh user@host
Opens a remote shell
Pipes and redirects
ls -la | grep ".md" # send one command's output into anotherecho "hello" > out.txt # write to a file (replaces it)echo "more" >> out.txt # append to a file
Press Tab to autocomplete and the up arrow to bring back earlier commands. Use man <command> to read the manual.