October 14, 2026
# 20 Linux Commands That Turn Your Terminal Into a Cybersecurity Powerhouse
You donβt need to be a hacker to use Linux. You just need to know where to start.

By MR.Kanishk Meghwal
6 min read
When I first saw a Linux terminal, it looked like one of those screens you see in hacker movies. Just a black background, some text, and a lot of commands that didn't make much sense.
But here's the interesting part: you don't need to be a coding genius to use it.
Linux is used by developers, system administrators, cybersecurity professionals, and people who simply enjoy having more control over their computers. And one of the best ways to get comfortable with Linux is to start learning its commands.
So, if you're a CS beginner who wants to explore Linux, ethical hacking, or penetration testing, here are 20 commands worth learning.
1. pwd β Where Am I?
Imagine opening your terminal and having absolutely no idea which folder you're in. That's where pwd comes in.
pwd
It shows your current directory.
For example, /home/user means you're working inside the user's home directory.
Simple, but useful. Before doing anything, it's good to know where you are.
2. ls β What's Inside This Folder?
ls
This command lists the files and folders in your current location.
Want more details? Try these:
ls -l ls -a ls -lah
The first shows detailed file information, the second includes hidden files, and the third combines those options with human-readable file sizes.
You'll probably use ls more often than you expect.
3. cd β Move Around Without Clicking
Linux doesn't require you to open folders with a mouse. You can move between them directly from the terminal.
cd Documents
A few other useful examples:
cd .. cd ~ cd /
cd .. moves you up one directory, cd ~ takes you to your home directory, and cd / takes you to the root directory.
Once you get used to it, moving around becomes much quicker.
4. mkdir β Create Folders in Seconds
Suppose you're starting your first cybersecurity project and want a separate folder for it.
mkdir cyber-lab
Done. You've created a directory called cyber-lab.
You can even create multiple levels of folders at once:
mkdir -p projects/linux/practice
It's a small command, but it makes organizing projects much easier.
5. touch β Create a File Quickly
Need an empty file for your notes or a script?
touch notes.txt
This creates notes.txt if it doesn't already exist.
For example:
touch scanner.py
Now you have an empty Python file ready to edit. Just remember that touch doesn't write code into it.
6. cat β Read Files Without Opening an Editor
cat notes.txt
This prints the contents of a file directly in your terminal.
It's handy when you want to check a configuration file, read notes, or quickly inspect a small script.
For larger files, use:
less notes.txt
You can scroll through the content and press q when you're finished.
7. cp β Make a Copy Before Things Go Wrong
We've all made changes to a file and wished we had kept the original. The cp command helps with that.
cp notes.txt notes-backup.txt
This creates a copy named notes-backup.txt.
To copy an entire directory, use:
cp -r project project-backup
It's a good habit to make backups before experimenting with unfamiliar configurations.
8. mv β Move or Rename Files
mv old.txt new.txt
This renames old.txt to new.txt.
You can also move files into another folder:
mv notes.txt Documents/
Instead of opening a file manager and dragging things around, you can do it in one line.
9. grep β Find What You're Looking For
This is where things start getting particularly useful for cybersecurity.
Imagine you've got a log file containing hundreds of lines and you're trying to find failed login attempts.
grep -i "failed" login.log
grep searches the file and displays lines containing the word failed. The -i option makes the search case-insensitive.
You can also search through files in a directory:
grep -r "password" ./project
This can help you investigate your own application logs or find specific text in your code. Be careful not to expose passwords or other secrets when sharing results.
10. find β Stop Searching for Files Manually
Ever forgotten where you saved a file? Linux has a command for that.
find . -name "*.py"
This searches the current directory and its subdirectories for files ending in .py.
Want to find every text file instead?
find . -type f -name "*.txt"
The . means the search starts in your current directory. It's a simple way to navigate larger projects without wasting time.
11. whoami β Which User Am I?
whoami
It prints the username of the current user.
You might wonder why this matters. Well, when you're working with permissions or troubleshooting a command, knowing which account you're using can save you some confusion.
12. chmod β Understand Who Can Access a File
Permissions are an important part of Linux security.
Try this on a test file:
chmod 600 secret.txt
This gives the file owner read and write permissions while removing access for the group and other users.
Another example:
chmod +x script.sh
This adds executable permission according to the applicable permission rules.
Understanding file permissions is useful for both Linux administration and ethical hacking. Just don't change permissions on important system files without knowing what you're doing.
13. ps β See What's Running
Your computer often runs more processes than you realize.
ps aux
This displays information about running processes, including their IDs, owners, and resource usage.
Want to look for Python processes?
ps aux | grep python
The | symbol passes the output of one command to another. Here, grep filters the list for lines containing python.
This is a great example of how Linux commands can work together.
14. top β Watch Your System in Real Time
top
Unlike a basic process listing, top updates the display while it runs.
You can use it to observe CPU usage, memory usage, and active processes.
If your computer suddenly feels slow, this command can help you investigate which processes are consuming resources.
Press q to exit.
15. kill β Stop a Process That Won't Behave
Sometimes a program freezes or refuses to close normally.
Linux lets you send it a signal using its process ID:
kill 1234
Replace 1234 with the actual process ID. This sends the default termination signal.
There's also:
kill -9 1234
This sends a forceful termination signal. Use it only when necessary because the process doesn't get a chance to clean up normally.
Despite the dramatic name, this command is simply about managing computer processes.
16. ip addr β Get to Know Your Network
If you're interested in cybersecurity, understanding networking is a must.
Start with:
ip addr
It displays your network interfaces and their IP addresses.
You can also run:
ip route
This shows your system's routing table, helping you understand how network traffic is directed.
These commands are useful when you're learning how your own computer connects to a network.
17. ping β Check Whether a Host Responds
ping -c 4 example.com
This sends four ICMP echo requests to the specified host and reports any responses.
It's a useful first step when troubleshooting connectivity.
One thing to remember: a host might block ping requests even when its website or other services are working. So, no response doesn't automatically mean the server is down.
18. ss β See Which Ports Are Listening
Ports are an important part of networking, and understanding them helps you learn how services communicate.
Try:
ss -tuln
This displays listening TCP and UDP sockets using numeric addresses and port numbers.
Here's what the options mean:
-tβ TCP-uβ UDP-lβ Listening sockets-nβ Numeric output
It's a useful way to inspect services listening on your own Linux machine.
19. ****_curl_**** β Talk to Websites and APIs
If you're learning web development or API security, get comfortable with curl.
curl -I https://example.com
This sends an HTTP HEAD request and displays the response headers.
You'll see information such as the HTTP status code and content type, depending on the server's response.
To request the response body instead:
curl https://example.com
Developers use curl to test APIs, troubleshoot websites, and inspect HTTP responses. When learning security testing, stick to systems you own or have permission to assess.
20. ****_man_**** β Learn Commands You Don't Know Yet
Here's something beginners often forget: nobody knows every Linux command.
That's why this command is worth learning:
man grep
It opens the manual for grep, explaining its options and usage.
You can do the same with other commands:
man ls man chmod man curl
Press q to leave the manual.
Honestly, learning how to read documentation is more valuable than memorizing hundreds of commands.
Bonus: The Real Power Is in Combining Commands
Knowing individual commands is a good start. But the terminal gets much more interesting when you combine them.
For example:
ps aux | grep python
One command lists processes, and the other filters the results.
You can also run:
ip addr && ip route
The && operator runs the second command only if the first succeeds.
These little combinations are part of what makes Linux so flexible. You can build useful workflows without needing a complicated graphical tool for everything.
Your First Linux Practice Challenge
Don't just read these commands and forget them. Open a Linux terminal and try a few yourself.
- Create a folder named
_cyber-lab_. - Create a file called
_notes.txt_. - Add some sample text using a text editor.
- Search that text using
_grep_. - Find your text files using
_find_. - Check your IP addresses using
_ip addr_. - Inspect listening ports using
_ss -tuln_. - Read the manual for
_grep_.
If something doesn't work the first time, that's completely normal. Learning the terminal involves experimenting, making mistakes, and understanding why they happen.
Use your own machine, a virtual machine, or an authorized lab for practice.
Final Thoughts
Linux might look intimidating when you're starting out, but most of these commands are easier to understand than they first appear.
You don't need to become an expert overnight. Learn a few commands, try them yourself, and gradually build on what you know.
If you're a CS student interested in programming, Linux, or penetration testing, these basics will give you a solid foundation for the more advanced tools you'll explore later.
The goal isn't to memorize commands. It's to understand what you can do with them.
Keep learning, keep experimenting, and always practice responsibly.