The basic Linux commands for beginners, including file management, system information, and process control.
If you’re new to Linux or just need a quick refresher, you’re in the right place. I’ve put together this cheat sheet of the most commonly used Linux commands - the ones I actually use day-to-day, not just theoretical stuff.
Whether you’re SSH’d into a server at 2 AM trying to figure out why something broke, or just getting started with Linux, having these commands at your fingertips is a lifesaver. I’ve organized them by category so you can quickly find what you need.
FILES & NAVIGATING
These are your bread and butter - you’ll use them constantly.
lsโ directory listingls -lโ formatted listingls -laโ formatted listing including hidden filescd dirโ change directory to dircd ..โ change to parent directorycd ./dirโ change to dir in parent directorycd ~โ change to home directorypwdโ show current directory (“where am I?”)mkdir dirโ create a directoryrm fileโ delete filerm -f dirโ force remove filerm -rf dirโ delete directory dirrm -r dirโ remove directory dirrm -rf /โ DON’T DO THIS. Seriously. This nukes your entire systemcp file1 file2โ copy file1 to file2mv file1 file2โ rename file1 to file2mv file1 dir/file2โ move file1 to dir as file2touch fileโ create or update filecat fileโ output contents of filecat > fileโ write standard input into filecat >> fileโ append standard input into filetail -f fileโ output contents of file as it grows (great for watching logs)
SYSTEM INFO
When you need to know what’s actually running and how it’s performing:
dateโ show current date/timeuptimeโ show uptime (how long has this server been running?)whoamiโ who you’re logged in aswโ display who is onlinecat /proc/cpuinfoโ display CPU infocat /proc/meminfoโ memory infofreeโ show memory and swap usageduโ show directory space usagedu -shโ displays readable sizes in GB (much more human-friendly)dfโ show disk usageuname -aโ show kernel config
NETWORKING
For when you need to download stuff or debug connection issues:
ping hostโ ping host (is it alive?)whois domainโ get whois info for domaindig domainโ get DNS info for domaindig -x hostโ reverse lookup hostwget fileโ download filewget -c fileโ continue stopped download (lifesaver for large files)wget -r urlโ recursively download files from URLcurl urlโ outputs the webpage from URLcurl -o meh1.html urlโ writes the page to meh1.htmlssh user@hostโ connect to host as userssh -p port user@hostโ connect to host on specific portssh -D user@hostโ connect & use bind port
COMPRESSING
tar cf file.tar filesโ tar files into file.tartar xf file.tarโ untar into current directorytar tf file.tarโ show contents of archive
tar options:
cโ create archivetโ table of contentsxโ extractzโ use zip/gzipfโ specify filenamejโ bzip2 compressionwโ ask for confirmationkโ do not overwriteTโ files from filevโ verbose
PERMISSIONS
This trips up a lot of people, but it’s actually pretty simple once you get it:
chmod octal fileโ change permissions of file
Permission values:
4โ read (r)2โ write (w)1โ execute (x)
Add them up for combinations. So read + write = 6, read + execute = 5, all three = 7.
Order:
owner/group/world
Common examples:
chmod 777โ rwx for everyone (use sparingly - it’s a security risk)chmod 755โ rwx for owner, rx for group/world (good for scripts)chmod 644โ rw for owner, r for everyone else (good for files)
PROCESSES
For managing what’s running on your system:
psโ display currently active processesps auxโ detailed outputs (shows everything)kill pidโ kill process with process id (pid)killall procโ kill all processes named proc (be careful with this one)
SEARCHING & FINDING STUFF
Because we all spend half our time looking for files:
grep pattern filesโ search in files for patterngrep -r pattern dirโ search for pattern recursively in dir (searches subdirectories too)locate fileโ find all instances of file (fast, uses a database)whereis appโ show possible locations of appman commandโ show manual page for command (RTFM in action)
Pro tip: When in doubt, man is your friend. Almost every command has a manual page. Just type man [command] and you’ll get detailed info about what it does and all its options.
Bookmark this page or keep it handy - even experienced Linux users look up syntax all the time. No shame in that!


