Kali Linux Command Line Essentials (original) (raw)

Last Updated : 17 Nov, 2025

The command line interface (CLI) is a crucial part of working with Kali Linux, as most of its powerful tools and utilities operate without a Graphical User Interface (GUI). When performing ethical hacking, penetration testing, or system administration, you’ll spend most of your time interacting directly with the terminal.

Kali Linux Command Line Essentials

There are some commands in Kali Linux which we use too frequently. So we should be aware of those commands as it could increase our productivity.

**1. To display present working directory

**Command:

pwd

**Output:

To-display-present-working-directory

**2. To list the directories and files in the current directory.

**Command:

ls

**Output:

To-list-the-directories-and-files-in-the-current-directory

**3. To change the current working directory

**Command:

cd

**Output:

To-change-the-current-working-directory

**4. Search for a Word in a File

**Command:

grep keyword filename

**Output:

To-find-a-word-in-a-file

**5. To create a new directory

mkdir directory_name

To-create-a-new-directory

This command will create a new directory in the current folder with the name **directory_name.

**6. To remove a directory

**Command:

rmdir directory_name

**Output:

To-remove-a-directory

**7. To move a file

**Command:

mv source destination

**Output:

To-mv-a-file

This command is used to move a file from one location to another.

**8. To copy a file

**Command:

cp source destination

**Output:

To-copy-a-file

**9. To create a new file

**Command:

touch filename

**Output:

To-create-a-new-file

**10. To display manual of a command

**Command:

man ls

**Output:

To-display-manual-of-a-command

**11. To check the internet connection or to check whether the host is active or not.

**Command:

ping google.com

**Output:

To-check-the-internet-connection-or-to-check-weather-the-host-is-active-or-not

**12. To display network interface details.

**Command:

ifconfig

**Output:

To-display-network-interface-details

**13. To download a file

**Syntax:

wget link_to_file

**Output:

To-download-a-file

**14. To install a package

**Syntax:

sudo apt install package_name

**Command:

sudo apt install netcat

To-install-a-package

**15. To remove a package

**Syntax:

sudo apt remove package_name

**Command:

sudo apt remove netcat

**Output:

To-remove-a-package

**16. To upgrade packages in the system

**Command:

sudo apt upgrade

**Output:

To-upgrade-packages-in-the-system

**17. To fetch the packages updates

**Command:

sudo apt update

**Output:

To-fetch-the-packages-updates

**18. To get the current username

**Command:

whoami

**Output:

To-get-the-current-username

**19. To change the current user to superuser or root

**Command:

sudo su

**Output:

To-change-the-current-user-to-superuser-or-root

**20. Print Text on the Terminal

**Command:

echo " To print something on terminal"

**Output:

To-print-in-terminal