Contact, if you are interested in this website / domain name / Sponsorship / Advertisement / Partnership
Network & IT · 10 min read · Updated 2026-10-16

Linux Command Line Basics: 30 Commands to Get Productive

Navigate files, inspect logs, manage processes and permissions, and chain commands with pipes — a practical Linux terminal primer.

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 grep or grep --help.
  • Use sudo only when needed, and double-check any rm -rf.
  • Automate repeat tasks with a shell script and schedule it with cron.

Try the tools

Found an error or want a topic covered? Tell us — we review every message.
Get a free tech stack audit