Basic Kali Linux Commands: A Beginner’s Guide for Ethical Hacking (Part -3)
Welcome to another helpful and beginner-friendly blog from hiranmoypati.com! Today, we’re diving into the core of every Linux system – the command line. If you’re learning Kali Linux for ethical hacking, cybersecurity, or even personal exploration, you’ll quickly realize that mastering the terminal is crucial.
In this blog, we’ll walk you through some of the most commonly used and helpful commands in Kali Linux:echo
, cat
, mmv
, ps
, ps aux
, vi
, nano
, free
, and df
.
Let’s break them down with simple explanations, practical examples, and a friendly tone—so even if you’re a beginner, you’ll feel confident using them in your daily Linux life.
🔊 1. echo
– Display a Line of Text
The echo
command is used to display a message or print text to the terminal.
🧪 Example:
echo "Welcome to hiranmoypati.com"
🧠 Output:
Welcome to hiranmoypati.com
You can also use echo
to display the value of variables:
name="Hiranmoy"
echo "Hello, $name!"
Output:
Hello, Hiranmoy!
echo
is often used in shell scripts to display output or log messages.
📄 2. cat
– View Content of Files
The cat
command (short for “concatenate”) allows you to read and display the contents of files.
🧪 Example:
cat file.txt
🧠 Output:
Shows everything inside file.txt
.
Want to create a file with cat
?
cat > myfile.txt
Now type something and press Ctrl + D
to save it.
To append content to an existing file:
cat >> myfile.txt
Great for viewing logs or quick notes!
🔁 3. mmv
– Move/Batch Rename Files
mmv
is a powerful tool for batch-renaming and moving files using wildcards. It’s not installed by default, so you’ll need to install it:
sudo apt install mmv
🧪 Example:
mmv "*.txt" "#1.md"
This will rename all .txt
files to .md
(e.g., notes.txt
becomes notes.md
).
Another example:
mmv "image_#1.jpg" "photo_#1.jpg"
Super useful for managing a bunch of files at once, especially in scripts.
🔍 4. ps
– Process Status
The ps
command shows information about active processes.
🧪 Example:
ps
🧠 Output:
Shows your current shell session processes. To see more detailed process lists, use ps aux
(see next section).
This is great for checking what’s running and their process IDs (PIDs), which can be useful for stopping unresponsive tasks.
🔬 5. ps aux
– Detailed View of All Processes
This is an expanded version of ps
. It shows all processes running on your system, not just those belonging to the current user.
🧪 Example:
ps aux
🧠 Output:
You’ll see columns like:
- USER: Who started the process
- PID: Process ID
- %CPU and %MEM: Resource usage
- COMMAND: The actual command or program
Need to find a specific process?
ps aux | grep firefox
This filters the results to only show processes with “firefox” in them.
✍️ 6. vi
– The Powerful Text Editor
vi
is a classic and lightweight terminal-based text editor. It can be intimidating at first, but it’s extremely powerful once you get the hang of it.
🧪 Opening a File:
vi test.txt
Basic vi
commands:
- Press
i
to enter insert mode - Type your content
- Press
Esc
to exit insert mode - Type
:w
to save - Type
:q
to quit - Use
:wq
to save and quit
If you make a mistake:
:q!
Quits without saving.
vi
is handy when you’re SSHing into a server and need a quick, lightweight editor.
🧾 7. nano
– The Beginner-Friendly Text Editor
Not a fan of vi
? No worries! nano
is here.
Nano is simple and comes with on-screen shortcuts. It’s perfect for beginners.
🧪 Example:
nano myfile.txt
Start typing directly. Use the following keys:
Ctrl + O
to saveEnter
to confirm the filenameCtrl + X
to exit
Super easy and intuitive—great for editing configuration files or scripts.
🧠 8. free
– Show Memory Usage
Want to know how much RAM is available or used? Use free
.
🧪 Example:
free -h
🧠 Output:
total used free shared buff/cache available
Mem: 7.6G 2.1G 3.4G 120M 2.1G 5.1G
Swap: 2.0G 0B 2.0G
-h
makes the output human-readable (G for GB, M for MB)- Helps you track memory leaks or monitor system performance
💽 9. df
– Disk Space Usage
The df
command shows how much disk space is used and available on your drives.
🧪 Example:
df -h
🧠 Output:
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 50G 18G 30G 40% /
Like free
, using -h
makes the output easy to understand.
Very useful for checking if your system is running out of space or where space is being used up.
🧵 BONUS TIP: Combining Commands with Pipes
Linux becomes more powerful when you chain commands using pipes (|
) and redirection.
🧪 Example:
ps aux | grep apache
This searches running processes for “apache”. You can combine this with kill
to stop a process.
kill -9 PID_NUMBER
Where PID_NUMBER
is the number you found using ps aux
.
🧰 Final Words – Practice Makes Perfect
The terminal might look intimidating at first, but it’s a powerful tool. These commands are some of the most useful in day-to-day usage on Kali Linux or any Linux distro.
Command | Use Case |
---|---|
echo | Display text or variables |
cat | Read or write file content |
mmv | Batch rename or move files |
ps | Show current processes |
ps aux | Show all system processes |
vi | Edit files in a powerful environment |
nano | Simple text editing |
free | View memory usage |
df | Check disk space usage |
Learning these commands will make you faster, smarter, and more effective on the command line. So open up your Kali terminal, try them out, and don’t be afraid to explore!
If you’re interested in more Kali Linux tutorials, ethical hacking tips, or productivity hacks—make sure to bookmark hiranmoypati.com, follow us on social media, and subscribe to our newsletter.
💬 Got a Question?
Drop your doubts or favorite command in the comments below. We love hearing from fellow tech enthusiasts!
Happy Hacking! 🐱💻
YVxdgDm mMR ZmqerBY