Video: Introduction to Linux – Full Course for Beginners (freeCodeCamp.org). Embedded from YouTube in privacy-enhanced mode; all rights belong to the creator.
Most of the internet runs on Linux: web servers, containers, cloud VMs, routers and Android phones. Even on macOS or Windows (via WSL), the same shell skills apply. You don't need to memorise hundreds of commands — around thirty cover almost everything a developer or IT pro does daily.
Navigating the filesystem
pwd # where am I?
ls -lah # list files, long format, human sizes, hidden files
cd /var/log # change directory (cd ~ = home, cd - = previous)
mkdir -p a/b/c # create nested directories
cp -r src dest # copy (recursive for folders)
mv old new # move or rename
rm -r folder # delete — there is no recycle bin!
find . -name "*.log" -mtime -1 # files changed in last day
Reading and searching files
cat file # print a file
less file # page through (q to quit, / to search)
head -n 20 file # first 20 lines
tail -f app.log # follow a log live
grep -rin "error" . # recursive, case-insensitive search with line numbers
wc -l file # count lines
Pipes and redirection: the superpower
The pipe | sends one command's output into the next, letting small tools combine into powerful one-liners:
# top 10 IP addresses hitting a web server
awk '{print $1}' access.log | sort | uniq -c | sort -rn | head
# save output, append, or discard errors
cmd > out.txt cmd >> out.txt cmd 2>/dev/null
Permissions
ls -l shows permissions like -rwxr-x---: read/write/execute for the owner, group and others. Change them with chmod (chmod 755 script.sh or chmod +x script.sh) and ownership with chown user:group file. Each octal digit is a sum: read 4 + write 2 + execute 1 — convert with our number base converter.
Processes and system health
top / htop # live process view
ps aux | grep nginx # find a process
kill PID # politely stop (kill -9 only as a last resort)
df -h # disk space per filesystem
du -sh * # size of each item here
free -h # memory usage
systemctl status nginx # service status (systemd)
journalctl -u nginx -f # follow a service's logs
Networking
ip a # your interfaces and IPs
ping -c 4 host # reachability
curl -I https://example.com # fetch headers only
dig example.com MX # DNS lookup
ss -tulpn # listening ports
ssh user@server # remote login (use keys, not passwords)
Habits of efficient users
- Press Tab to autocomplete and Ctrl+R to search history.
- Read the manual:
man greporgrep --help. - Use
sudoonly when needed, and double-check anyrm -rf. - Automate repeat tasks with a shell script and schedule it with cron.
Try the tools
Cron Expression Explainer
Translate cron schedules to plain English and preview next runs.
Subnet / CIDR Calculator
Network, broadcast, host range and mask for any IPv4 CIDR.
Hash Generator (MD5, SHA-256…)
Live MD5, SHA-1, SHA-256, SHA-384 and SHA-512 hashes of any text.