The commands from the Linux series, collected in one place — the dog-eared card for when you’re staring at a strange prompt and just need the thing. Grouped by what you’re trying to do. Examples are Debian/Ubuntu-flavoured (apt); where RHEL/AlmaLinux differs, it’s noted.
Orient yourself
Command
What it tells you
whoami
which user you are
id
your user, groups, and whether you can sudo
hostnamectl
the machine’s name, OS and kernel
uname -a
kernel version and architecture
uptime
how long it’s been up, and system load
w / who
who else is logged in
Move around
Command
What it does
pwd
where am I (print working directory)
ls -la
list everything here, long form, incl. hidden
cd <dir>
change directory
cd ~
go to your home directory
cd -
back to the previous directory
cd ..
up one level
Look inside files
Command
What it does
cat <file>
dump a file to the screen
less <file>
page through a file (q to quit)
head -n 20 <file>
the first 20 lines
tail -n 20 <file>
the last 20 lines
tail -f <file>
follow a file live — perfect for logs
grep "term" <file>
find lines matching a pattern
Files & folders
Command
What it does
cp <src> <dst>
copy a file
mv <src> <dst>
move or rename
mkdir -p <path>
make directories, parents included
touch <file>
create an empty file / update its timestamp
rm <file>
delete a file
rm -rf <dir>
delete a directory and everything in it — no undo
ln -s <target> <link>
make a symbolic link
Warning
There is no recycle bin at the shell. rm -rf deletes permanently and without asking — and run as root against the wrong path it will happily eat the whole system. Read the path twice, avoid running as root unless you must, and treat sudo as a deliberate act, not a reflex.