Skip to content
# Getting started

Essential commands cheat sheet

The dozen commands you'll type every single session: navigating, listing, copying, and reading files.

Moving around

pwd shows where you are, cd changes directory, ls lists what's there. -la shows hidden files with permissions and sizes.

bash
pwd
cd /var/www
ls -la
cd ..        # up one level
cd ~         # back to your home directory

Copying, moving and deleting

cp copies, mv both renames and moves, rm deletes. -r makes an operation recursive for directories; rm has no undo, so double-check the path before running it with -rf.

bash
cp file.txt backup.txt
cp -r site/ site-backup/
mv old-name.txt new-name.txt
rm file.txt
rm -r some-directory/

Reading files

cat dumps a whole file to the screen β€” fine for short files. less opens a scrollable pager for anything longer (q to quit, / to search).

bash
cat /etc/hostname
less /var/log/syslog

Getting help without leaving the terminal

man shows the full manual page for any command; --help gives a shorter summary most tools also support.

bash
man ls
tar --help