Beginner journey

Linux Basics for Cybersecurity: The Commands You Will Actually Use

Most servers, security tools and cloud machines run Linux. You do not need to master it in a week, but you do need to feel comfortable in a terminal. Here is a practical starting kit.

Linuxterminalcommands

Why Linux matters so much

When you work in security, you will meet Linux everywhere. Web servers, cloud instances, firewalls, routers and many security tools run on it. Attackers also love Linux servers because they often hold valuable data.

Many beginners install Kali Linux on day one and feel like hackers. Kali is useful, but it is just a Linux distribution with security tools pre installed. If you do not understand basic Linux, Kali will only confuse you. Start with a normal distribution like Ubuntu, learn the basics, and then explore Kali in your lab.

Reading and searching files

Security work is mostly reading. These commands help:

cat file.txt               # print a file
less /var/log/syslog       # scroll through a big file
head -n 20 file.txt        # first 20 lines
tail -f /var/log/auth.log  # follow new lines live
grep "Failed password" /var/log/auth.log

grep is your best friend. Combined with | (pipe), you can filter huge logs in seconds, for example grep "Failed password" auth.log | wc -l counts failed SSH logins.

Users and permissions

Every file has an owner, a group and permissions. Run ls -l and you will see something like -rwxr-x---. That means the owner can read, write and execute, the group can read and execute, and others can do nothing.

chmod 640 secret.txt   # owner rw, group r, others none
chown madhav file.txt  # change owner
whoami                 # which user am I?
sudo command           # run as administrator

Wrong permissions are a common real world weakness, for example a configuration file with a password that every user can read. Be careful with sudo. Never paste a command from the internet with sudo unless you understand every part of it.

Processes and networking

ps aux        # list running processes
top           # live view of CPU and memory
ip a          # show IP addresses
ss -tulpn     # which ports are listening, and by which program
ping 8.8.8.8  # basic connectivity test

ss -tulpn is very useful for defenders. If you see a strange program listening on an unusual port, that deserves a closer look. The networking ideas from Part 3 now become real.

Logs: where the evidence lives

On many Linux systems, logs live in /var/log. Files like auth.log (or secure on some distributions) record logins and sudo use. Newer systems also use journalctl. A SOC analyst who can quickly read these logs is valuable. We go deeper in Linux logs for beginners.

A 14 day practice plan

  • Days 1 to 3: navigation and files, 20 minutes a day.
  • Days 4 to 6: grep, pipes and reading logs.
  • Days 7 to 9: users, groups and permissions.
  • Days 10 to 12: processes, services and networking commands.
  • Days 13 and 14: play the free Linux terminal wargame on this site and keep notes.

Use a virtual machine on your own laptop so mistakes do not matter. Part 7 shows how to build that safe home lab. Next up, in Part 5, how the internet actually works end to end.

Frequently asked questions

Which distribution should I start with? Ubuntu or Debian are friendly for beginners and widely used on servers. Move to Kali or Parrot inside your lab once the basics feel easy.

Can I learn Linux on Windows? Yes. Windows Subsystem for Linux (WSL) gives you a real Linux shell on Windows, which is great for practising commands. For security tools that need network access, a virtual machine is better.

How do I remember so many commands? You do not need to memorise all of them. Use man command or command --help, keep a personal cheat sheet, and use the cheat sheets on the home page. Repetition does the rest.

Educational content, not legal advice. Check official sources before you rely on it. If you have lost money, call 1930 now. Terms