Kali Linux commands list – Basic to Advanced with Examples

Easiest way to use Kali Linux by commands but you should know there are thousands of the Kali Linux commands. And the biggest problem for the new user to learn these commands.

Overview of Kali Linux commands:

Kali Linux is an operating system similar to other Linux based operating systems. So basic Kali Linux commands are similar to others.

This Operating system is designed for penetration testing and Ethical hacking. Of course, It has a bunch of ultimate Free Hacking Tools used by black hat hackers.

So basic kali Linux commands are similar to other Linux operating systems but Advance commands are different and awesome.

Commands are made Kali Linux more Attractive and awesome

In this article, I am going to cover how to use Kali Linux commands exactly without knowing anything about the tool.

Many students want to learn Kali Linux free of cost, but due to lack of resource, They can’t. If you are one of them then this article is useful for you.

And they start searching online, and they find lots of articles written by multiple experts, These are available online, but most articles are related on How to install Kali Linux on VirtualBox, how to use tools of Kali Linux.

There is a big difference between the installation of the Kali Linux and using the Kali Linux tools. The gap is how to use Kali Linux commands still exist.

How to finish Kali Linux using Gap?

In this tutorial I will try to remove that gap, so you can complete your journey from installation to using the tools and get involved in penetration testing. In the last article, I have written about Kali Linux hacker so if you want to know more about Kali Linux you can go there and read about it. otherwise, you have another option to know about Kali Linux go on Official website Kali Linux
Before writing this article I think about lots of factor about commands, and find out that:

Kali Linux commands Categories:

  1. System commands
  2. Tool commands
  3. Switches Or Sub-tools

System Commands in Kali Linux:

System commands are basic commands which are used for a system administration, these commands are helpful to manage the Kali Linux operating system.

You can use these commands to manage another Linux Operating system, for example, Ubuntu, Mint, RHEL, etc.

As I have told you in my previous post “Kali Linux system is the combination of Linux OS and Hacking tools”. So all the basic commands are similar to other Linux System.

In this tutorial, I am going to describe basic and advanced Kali Linux commands to manage the operating system.
So good news here, First you will learn basic commands, then you can go for advanced kali Linux commands.

In the sense of meaning, all commands are the same for a normal user, sudo user, and Root user.

Basic Kali Linux commands:

Very basic commands can be used by Normal user. The identification of normal user ‘$’ sign, you can see in the following image vijay@kali:~$.

1# Date Command:


date command is used for checking the current date and time.

root@kali:~#date
Tue Oct  1 09:55:34 IST 2019
root@kali:~#

the date can be changed by running following code

$ date –set=’20 September 2019 13:09′

but the normal user can’t change system time, Then you are thinking about “how to change system time” Of-course I will teach you in this article, dont worry about it.

2# cal command:


Cal command is used to display calendar

$cal

root@kali:~#cal
    October 2019      
Su Mo Tu We Th Fr Sa  
       1  2  3  4  5  
 6  7  8  9 10 11 12  
13 14 15 16 17 18 19  
20 21 22 23 24 25 26  
27 28 29 30 31 
root@kali:~#

3# whoami command:


it is looking something difference command but it is used to tell about you. For example if you forget “which user is logged in?This command will tell you who are you current.

$whoami

Kali linux commands basic 1

4# pwd command:


pwd command is used for print working directory. It means “On what location you are“. here location meaning is directory and sub-directory.

The parent directory is “/” called root directory.

Don’t be confused with /root directory, this root directory “/root” is home directory for root user.

root@kali:~#pwd
/root
root@kali:~#

5# ls command:


ls command is used to see files and directory inside a directory. using ‘ls’ without any location will list the files and folders inside the current directory.

If you want to look up inside another directory, you will have to specify location.

$ls

$ls /var

$ls /home/username

oot@kali:~# ls
Desktop    Downloads  Pictures  Templates  virtualbox_6.0.10-dfsg-4kali1.dsc 
Documents  Music      Public    Videos     virtualbox_6.0.10-dfsg.orig.tar.xz
root@kali:~# ls /var/
backups  lib    lock  mail  run    tmp          www
cache    local  log   opt   spool  unicornscan
root@kali:~# 

6# cd command:


the cd command is a very useful command and plays a very important role for Linux user. This command is used for changing directory. And the basic syntax will be as below:

cd /desired/location

If you use blank ‘cd’ without location then you will move in the user’s home directory. so see the power of cd commands and enjoy!

$cd

$cd ..

$cd /desired/location ($cd /home/vijay)

Kali linux commands basic 2

7# mkdir command:


Do you know about the directory? It is a term used for the folder. You can say windows folder is a directory in Linux It is very easy to create a folder in Windows” but not in Linux. T

The graphical interface is really awesome, but the command interface is not less. The command-line interface is the fastest way to operate a Linux based Operating System. Linux users love it.

mkdir command is used to create a directory. if want to create a directory within the current directory, just use mkdir ‘directory name’.

if you want to create a directory in the desired location then

$mkdir /desired/location/directory name.

$mkdir lab

root@kali:~#mkdir lab
root@kali:~#mkdir lab/lab1
root@kali:~#

$mkdir /home/vijay/lab1

8# cat command:


These tutorial for hackers, So if you will get access of any computer of drive then you will 100% find some files. so cat command is used to see, edit matter inside the file. You can create a file and add content inside file.

How is it possible?

Simple use

$cat > ‘New File’ [Create a new file or overwrite data on the desired file] 

$cat “file name” [See matter inside file]

$ cat >> “filename” [add some data into file] 

Kali linux commands basic use cat

9# cp command:


cp command is used to copy files and folders from one location to another location. or copy in the new file name. This is big command and can be used in different ways. here you can read more about https://www.computerhope.com/unix/ucp.htm

10# mv command:


If you don’t like files and folders on the current location and want to move to another location, then mv command is useful for you. mv command work as a cut and paste in windows.

$mv /Source_location /destination/location

mv source location if the file or directory does not exist in current location if the file/folders within current location then us mv file/folder name [space] destination location {destination location = where you want to move}

mv command is also used for rename the file and folder

$mv ‘old filename’ ‘new filename’

11# rm command:


rm command is used to remove file and folder. In other word this command for deleting files and folders.


Kali linux commands basic 3

System Basic Kali Linux commands 


12# uname command:


Do you want to know the name of your Linux? if yes then use uname command 
The “uname” stands for (Unix Name), display detailed information about the machine name, Operating System and Kernel.

$uname

$uname -a

root@kali:~#uname -a
Linux kali 5.2.0-kali2-amd64 #1 SMP Debian 5.2.9-2kali1 (2019-08-22) x86_64 GNU/Linux
root@kali:~#

13# uptime command:


this command is used to check how long your system is running. uptime for your system, this command can be used for forensics also.

root@kali:~#uptime 
 10:29:28 up 36 min,  1 user,  load average: 0.08, 0.08, 0.08
root@kali:~#

14# users command:


users command is used to check current logged in user, On my Kali Linux system I have logged in with root user and later I switched to vijay user.

root@kali:~#users 
root
root@kali:~#

15# Less Command


less command is used for quickly view file on terminal. user can page up and down. Press ‘q‘ to quit from less window.

$less /etc/passwd

root@kali:~#less /etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
_apt:x:100:65534::/nonexistent:/usr/sbin/nologin
systemd-timesync:x:101:102:systemd Time Synchronization,,,:/run/systemd:/usr/sbin/nologin
systemd-network:x:102:103:systemd Network Management,,,:/run/systemd:/usr/sbin/nologin
systemd-resolve:x:103:104:systemd Resolver,,,:/run/systemd:/usr/sbin/nologin
/etc/passwd

16#More Command


more command is used for quickly view file and shows details in percentage. Press up and down arrow for page up and down. Press ‘q‘ to quit out from more window.

$more /etc/passwd

root@kali:~#more /etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologi
n
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
_apt:x:100:65534::/nonexistent:/usr/sbin/nologin
systemd-timesync:x:101:102:systemd Time Synchronization,,,:/run/systemd:/usr/sbi
n/nologin
systemd-network:x:102:103:systemd Network Management,,,:/run/systemd:/usr/sbin/n
ologin
systemd-resolve:x:103:104:systemd Resolver,,,:/run/systemd:/usr/sbin/nologin
--More--(37%)

17# Sort command


You can sort lines of text files in ascending order. with -r options will sort in descending order.

$sort filename.txt [ascending order]

$sort -r filename.txt [descending order]

18#VI Command


Vi is a most popular text editor used for most of the UNIX-like OS. Here is a great article for vi editor 

19#Free command


The free command shows free, total and swap memory information in bytes.
Free with -t options shows total memory used and available to use in bytes.

$free

$free -t

free-command Kali linux basic

20# history command:


The history command is used to check recent running commands. Oh really it is useful because Forgetting is the nature of human. IF you forget previous running command, you can use history command.

$history

history-command in kali linux

System Advanced Kali Linux commands

#21: Find Command

The find command is used for search files in Linux. Searching any files and folders in Windows is easy but in Linux.

To find a file by name, size, type, etc in the graphical interface is quite easy, And it is not really so easy in CLI (Command Line Interface)

Find is a command-line utility that allows you to search for files and directories in a directory hierarchy based on user-given expression and applies user-specified action on each matched file

Usage: find [-H] [-L] [-P] [-Olevel] [-D debugopts] [path…] [expression]

root@kali:~#find -L /etc -name passwd
/etc/pam.d/passwd
/etc/passwd
root@kali:~#

More Detail: How to Find a File in Linux in All Directories

#22 apt-get command:

apt-get is a package manager used to install, remove, purge, and update packages.

the apt-get command is a most popular command for Debian based operating systems including Kali Linux.

All the available options are below with apt-get command.

#22 dpkg command

dpkg command is used to Install deb File in Kali Linux. You can remove packages by using dpkg command as well.

Kali Linux is Debian based operating system so you can install .deb files only.

For the example: you can install Nessus on Kali Linux by using dpkg because the Nessus files do not exist in the repository.

You can run the following command to install packages on Kali Linux by using dpkg command

#dpkg -i package_name

dpkg –i /{Download_Location}/Nessus-{Version}.deb

More Details: Install Nessus on Kali Linux

How to install deb files on Linux

#23 Du Command

The du command is used to display the amount of disk space used by files and directories.

If you run command du without specified path then it will give the result behalf of the current working directory.

If you run du command followed by a specific path, it will summarize disk usage of each file and subdirectories in that directory.

I used the du command without any argument and path. I got a shocking result. You run the command now, check the result and tell me our experience in the comment box.

root@kali:~#du
4	./Pictures
4	./.mozilla/extensions
36	./.mozilla/firefox/l6ruxl24.default/saved-telemetry-pings
12	./.mozilla/firefox/l6ruxl24.default/sessionstore-backups
4	./.mozilla/firefox/l6ruxl24.default/minidumps
56	./.mozilla/firefox/l6ruxl24.default/datareporting/archived/2019-08
40	./.mozilla/firefox/l6ruxl24.default/datareporting/archived/2019-09
100	./.mozilla/firefox/l6ruxl24.default/datareporting/archived
112	./.mozilla/firefox/l6ruxl24.default/datareporting
8	./.mozilla/firefox/l6ruxl24.default/bookmarkbackups
4	./.mozilla/firefox/l6ruxl24.default/storage/permanent/chrome/idb/1657114595AmcateirvtiSty.files
4	./.mozilla/firefox/l6ruxl24.default/storage/permanent/chrome/idb/3561288849sdhlie.files

More: Du Command to get Size of Directory in Linux

#24 Curl command

Curl is a command-line utility to transfer data from or to a server. You can say it is used to download and upload files and data by using one of the supported protocols (DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET and TFTP). The command is designed to work without user interaction.

curl offers a busload of useful tricks like proxy support, user authentication, FTP upload, HTTP post, SSL connections, cookies, file transfer resume, Metalink, and more. As you will see below, the number of features will make your head spin! See libcurl(3) for details

Use the following command to know more about #curl

#curl –help

More Details: What is Curl in Linux, How to use? You should check these methods

#25 Adduser command

Adduser command is used to add new user. You can create multiple users by using adduser command.

#adduser username

root@kali:~#adduser vijay
Adding user `vijay' ...
Adding new group `vijay' (1000) ...
Adding new user `vijay' (1000) with group `vijay' ...
Creating home directory `/home/vijay' ...
Copying files from `/etc/skel' ...
New password: 
Retype new password: 
passwd: password updated successfully
Changing the user information for vijay
Enter the new value, or press ENTER for the default
	Full Name []: Vijay Kumar
	Room Number []: 22
	Work Phone []: 9999778951
	Home Phone []: same
	Other []: Ethical hacking trainer
Is the information correct? [Y/n] y
root@kali:~#

More Details: How to Create User in Linux by Adduser

#25 lsb_release command to check version of Kali Linux

lsb_relase command is used to check the version of Kali Linux. There are multiple switches are used with this command.

#lsb_release -a

root@kali:~#sb_release -a
No LSB modules are available.
Distributor ID:	Kali
Description:	Kali GNU/Linux Rolling
Release:	2019.3
Codename:	kali-rolling
root@kali:~#

Check version of Linux

#26 SCP command scp

scp command is used to copy files from one device to another device securely. There are multiple ways to transfer files from one system to another.

But scp copy files over ssh protocol. One system should have an ssh server running.

Hacker used this command when the compromised system and transfer files. Basic syntax as bellow.

$scp [OPTION] [user@]SRC_HOST:]file1_Path [user@]DEST_HOST:]file2

More Details: How to use SCP command in Linux Copy files securely through ssh server

If Appreciate My Work, You should consider:

Vijay Kumar

Ethical Hacking & Penetration Testing Trainer, For more detail view My Profile

One thought on “Kali Linux commands list – Basic to Advanced with Examples

  • December 11, 2017 at 2:00 pm
    Permalink

    So let’s say I’m going to use metasploit, does the command used in metasploit is same with the others?

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *