Basic Kali Linux Commands: A Beginner's Guide for Ethical Hacking (Part -2)

Basic Kali Linux Commands: A Beginner’s Guide for Ethical Hacking (Part -2)


Welcome to hiranmoypati.com! If you’re stepping into the exciting world of ethical hacking, penetration testing, or simply want to understand Linux better, you’ve probably heard of Kali Linux—the ultimate toolkit for cybersecurity professionals.

Whether you’re a total beginner or someone who just needs a refresher, this guide will walk you through some of the most essential Linux terminal commands, especially those frequently used in Kali Linux. We’ll keep it simple, friendly, and super practical—so you can start using these commands today!

Let’s get started!


🖥️ What is Kali Linux?

Before we dive into commands, a quick intro: Kali Linux is a Debian-based Linux distribution designed for digital forensics and penetration testing. It’s packed with hundreds of pre-installed tools and is a favorite among security researchers.

Working with Kali Linux means using the terminal a lot. And that’s where these basic commands come into play.


📂 1. pwd – Print Working Directory

This is the command that tells you where you are in the system. When you open the terminal, you’re always in a folder (called a directory). pwd shows you the full path of that folder.

🔍 Example:

pwd

Output:

/home/kali

This means you’re currently in the “kali” folder under the “home” directory.


📁 2. cd – Change Directory

Want to move between folders? cd is your best friend.

🔍 Example:

cd Documents

This moves you from your current folder to the Documents folder.

🔁 Other examples:

  • Go up one level: cd ..
  • Go to your home folder: cd ~
  • Go to root folder: cd /

📋 3. ls – List Files and Directories

Use this command to see what’s inside a folder.

🔍 Example:

ls

Output:

Desktop  Documents  Downloads  Music  Pictures

Easy, right?


📋 4. ls -a – List All (Including Hidden Files)

Some files are hidden in Linux (they start with a dot .). To see everything, including hidden files, use:

ls -a

Output:

.  ..  .bashrc  Documents  Downloads

📋 5. ls -l – Long Listing Format

Want detailed information about files and directories? Try:

ls -l

This shows permissions, owners, file size, and modification date.


📋 6. ls -al – Combined View

Combine both -a and -l to get a complete and detailed list, including hidden files.

ls -al

It’s one of the most used variations of ls.


🌳 7. tree – Directory Tree View

Want a visual structure of folders? Use tree.

🔍 Example:

tree

Output:

.
├── Desktop
├── Documents
│   └── Notes.txt
└── Downloads

💡 If it says tree: command not found, install it with sudo apt install tree.


📦 8. mkdir – Make Directory

Want to create a new folder? Use mkdir.

🔍 Example:

mkdir MyProjects

Now you’ve got a folder named MyProjects.


🗑️ 9. rmdir – Remove Directory

This command removes an empty folder.

rmdir MyProjects

If the folder isn’t empty, use rm -r instead (more on that below!).


🔁 10. mv – Move or Rename Files/Folders

This command is used to move or rename items.

🔍 Example 1 – Rename:

mv oldname.txt newname.txt

🔍 Example 2 – Move:

mv myfile.txt Documents/

You’ve now moved myfile.txt into the Documents folder.


✍️ 11. touch – Create an Empty File

Want a blank file to start editing? Use touch.

🔍 Example:

touch notes.txt

Now you have an empty file called notes.txt.


🧹 12. rm – Remove Files

This command deletes files (and directories with a special flag).

🔍 Example:

rm notes.txt

Gone forever (be careful—no recycle bin here!).

To delete folders and contents:

rm -r MyProjects

⚠️ Use this with caution—it permanently deletes files and folders.


❓ 13. cl – (Likely a Typo or Custom Alias)

In most standard Linux systems, cl doesn’t exist as a default command.

👉 If you’re trying to clear the screen, you probably meant:

clear

Or, just press Ctrl + L.


📄 14. cp – Copy Files and Directories

This command copies files or folders.

🔍 Example 1 – Copy a file:

cp notes.txt backup.txt

Now you have both notes.txt and backup.txt.

🔍 Example 2 – Copy folder:

cp -r folder1 folder2

The -r flag is required to copy directories.


🧠 Pro Tips for Using These Commands

Here are some handy tips to level up your command-line experience:

  • Use the Tab key to auto-complete file/folder names.
  • Use arrow keys to access previously used commands.
  • Start typing and press Tab twice to see suggestions.
  • Use man <command> to see a manual (e.g., man ls).
  • Add --help for quick guidance (e.g., ls --help).

🛡️ Why These Commands Matter in Kali Linux

If you’re learning ethical hacking, you’ll be using tools like Nmap, Wireshark, Metasploit, and others—many of which operate from the terminal. Mastering these basic commands gives you the foundation to:

  • Navigate the file system
  • Organize tools and payloads
  • Work with scripts
  • Automate tasks
  • Understand file permissions

In short, it’s like learning how to walk before you run.


🧰 Suggested Practice

Here’s a mini-assignment to practice what you’ve learned:

  1. Open the terminal.
  2. Create a folder named KaliPractice.
  3. Move into it using cd.
  4. Create three files using touch.
  5. Create another directory inside it.
  6. Move one file into that sub-directory.
  7. List everything using ls -al.
  8. Copy one file.
  9. Delete one file.
  10. Remove the sub-directory.

By the time you finish, you’ll already feel more comfortable with Linux.


📝 Final Thoughts

Getting started with Linux—especially Kali Linux—might feel overwhelming at first, but once you master these basic commands, you’ll unlock the real power of the terminal. These 14 commands are like your ABCs in the Linux world.

At hiranmoypati.com, we believe learning should be accessible and friendly. Whether you’re an aspiring ethical hacker, tech enthusiast, or just someone who loves learning, these commands are your stepping stones toward deeper Linux knowledge.

If you found this blog helpful, share it with your friends and bookmark it for future reference. Want more Linux or ethical hacking tutorials? Drop a comment or email us. We’re building a community, and we’d love for you to be part of it.


📌 Stay tuned to hiranmoypati.com for more beginner guides, tech tutorials, and real-world insights into ethical hacking, web development, and more.

Until next time, happy hacking! 🔐💻