In this blog, we’ll walk through 12 super useful Kali Linux commands. We’ll keep things simple, beginner-friendly, and real—because learning should be fun, not scary! 😊
Let’s dive into:
tac
od
od --all
sleep
uft
head
tail
sort
lsof
lspci
grep
1. tac
: Print File in Reverse
While cat
displays a file’s contents from top to bottom, tac
does the opposite—it shows the lines from bottom to top.
📘 Syntax:
tac filename.txt
📌 Example:
Suppose you have a file lines.txt
with the following lines:
Line One
Line Two
Line Three
Run:
tac lines.txt
🖥️ Output:
Line Three
Line Two
Line One
✅ Use Case:
Useful for reading logs in reverse order or analyzing data bottom-up.
2. od
: Octal Dump
od
(Octal Dump) lets you view binary data in human-readable format like hexadecimal, octal, or ASCII.
📘 Syntax:
od filename
📌 Example:
echo "hello" > demo.txt
od demo.txt
🖥️ Output:
0000000 150 145 154 154 157 012
0000006
Each number represents a character in ASCII.
3. od --all
: Full Format Dump
You can use od
with the --format=all
(or simply --all
) option to see data in all common formats: hexadecimal, octal, ASCII, etc.
📘 Syntax:
od --format=all filename
📌 Example:
od --format=all demo.txt
🖥️ Output includes:
- Character representation
- Octal values
- Hex values
- ASCII values
This is especially helpful in reverse engineering or malware analysis.
4. sleep
: Pause Execution
Need to delay a process? sleep
is your go-to command to pause script execution for a specific time.
📘 Syntax:
sleep [seconds]
📌 Example:
sleep 5
🕐 Waits for 5 seconds before executing the next command.
✅ Use Case:
Perfect for automating scripts with controlled delays or cooldowns between actions.
5. uft
: ⚠️ Possible Mistype?
There is no standard Linux command called uft
. Did you mean:
uftpd
– a lightweight FTP server?uft
– as a typo forcut
oruftp
?
Please verify and I’ll update this section. (You can skip this for now if it was a typo.)
6. head
: Display First Lines
Want to quickly preview the top of a file? Use head
!
📘 Syntax:
head filename
By default, it shows the first 10 lines.
📌 Example:
head demo.txt
To show a specific number of lines:
head -n 5 demo.txt
7. tail
: Display Last Lines
The opposite of head
, tail
shows the last lines of a file.
📘 Syntax:
tail filename
📌 Example:
tail -n 3 demo.txt
✅ Use Case:
Frequently used for watching log files in real-time:
tail -f /var/log/syslog
8. sort
: Organize Text
Sort the lines in a file alphabetically or numerically.
📘 Syntax:
sort filename
📌 Example:
If names.txt
contains:
Zebra
Apple
Mango
Run:
sort names.txt
🖥️ Output:
Apple
Mango
Zebra
Add -r
to sort in reverse.
9. lsof
: List Open Files
lsof
(List Open Files) shows which files are currently open by processes.
📘 Syntax:
lsof
📌 Example:
lsof -u yourusername
List all open files for a specific user.
Another one:
lsof -i :80
Shows which process is using port 80.
✅ Use Case:
Ideal for troubleshooting file locks, open ports, and network issues.
10. lspci
: List PCI Devices
Curious about your hardware? Use lspci
to display information about PCI buses and connected devices.
📘 Syntax:
lspci
📌 Example Output:
00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC
00:01.0 VGA compatible controller: VMware SVGA II Adapter
✅ Use Case:
Perfect for checking graphics cards, network cards, and more.
11. grep
: Pattern Matching Hero
grep
is one of the most powerful tools in Linux. It searches for patterns (text) inside files.
📘 Syntax:
grep "pattern" filename
📌 Example:
grep "error" /var/log/syslog
This finds all lines that contain the word “error”.
Use with -i
to ignore case:
grep -i "ERROR" syslog
Combine with ps
to find running processes:
ps aux | grep apache
✅ Use Case:
- Log analysis
- Keyword search
- Filtering output
Bonus Tips 💡
Here are some practical combos and tricks using the above commands:
➤ Monitor a Log File for Errors in Real Time:
tail -f /var/log/syslog | grep "error"
➤ Wait Before Executing Another Command:
sleep 10 && echo "10 seconds later..."
➤ Reverse and Sort a File:
tac names.txt | sort
➤ Display Hardware Info:
lspci | grep VGA
Final Words
Learning Kali Linux commands doesn’t have to be overwhelming. Start small, experiment, and use commands like tac
, od
, head
, grep
, and lsof
to get comfortable navigating and managing your system like a pro.
If you’re serious about ethical hacking or system administration, these commands are more than just tools—they’re your daily companions. Bookmark this guide and practice often!
👋 Let’s Connect!
If you enjoyed this post, explore more beginner-friendly tech blogs at hiranmoypati.com. Whether you’re learning ethical hacking, Excel, or growing your digital brand—I’ve got you covered.
Happy hacking, and see you in the next blog! 🚀