Kali Linux Basic Commands - Javatpoint
Kali Linux Basic Commands - Javatpoint
Home Python Java JavaScript HTML SQL PHP C#
Exploitation Tools
Forensic Tools
Reporting Tools
https://www.javatpoint.com/kali-linux-basic-commands 1/16
11/9/24, 11:00 AM Kali Linux Basic Commands - javatpoint
Misc.
← prev next →
Kali Linux comprises various tools that can be used for wireless attacks, hardware
hacking, forensics, stress testing, and reverse engineering. A USB disk, hard disk, or
Live DVD can be used to install it. Network services are HTTP, MYSQL, and SSH. These are
quite useful when using the Kali Linux commands.
Kali Linux operates on some android devices. Its predecessor is Backtrack which was
carried over to Kali via Live Boot. The system becomes easy to use once the users get the
command over it.
1. Date Command
2. Cal Command
3. Cd command
4. Cp command
5. Whoami Command
6. Ls command
7. cat command
https://www.javatpoint.com/kali-linux-basic-commands 2/16
11/9/24, 11:00 AM Kali Linux Basic Commands - javatpoint
8. mkdir command
9. rm command
10. mv command
11. Uname command
12. Uptime command
13. Users Command
14. Less command
15. More command
16. Vi Command
17. Free Command
18. Sort Command
19. History Command
20. Pwd Command
1. Date Command
In Kali Linux, the 'date' command is used to display the system date and time. In order to
display the date, we have to use the following command:
Syntax:
# date
2. Cal Command
The cal command displays the current month's formatted calendar on our terminal
screen. If we require a more advanced version of cal, we can install the ncal package on our
Linux machine, which displays the calendar vertically and provides additional options.
Syntax
# Cal
https://www.javatpoint.com/kali-linux-basic-commands 3/16
11/9/24, 11:00 AM Kali Linux Basic Commands - javatpoint
3. Cd Command
The 'cd' command is also called chdir (Change Directory). We used this command to
change or switch the current working directory.
4. cp Command
In Kali Linux, the 'cp' command is used to copy files or a group of files or directories that
create an exact image of a file on a disk with a different file name.
5. whoami Command
The 'whoami' command is used to print the effective user ID whereas the who command
prints information regarding users who are presently logged in.
The "w" command can also be used to view who is logged on and what they are doing.
6. Ls Command
https://www.javatpoint.com/kali-linux-basic-commands 4/16
11/9/24, 11:00 AM Kali Linux Basic Commands - javatpoint
One of the most useful commands in Kali Linux is the 'ls' command. The ls command lists
the directory contents of files and directories. With the help of the ls command, we can
easily list out every hidden file of a directory with the -a attribute, and for more detailed
output, we can use the -l attribute.
Syntax
# ls -al
7. Cat Command
The 'cat' (concatenate) command is one of Kali Linux's most commonly used commands,
permitting us to create single or many files, concatenate files and redirect, view contain of
file output in terminal or files.
Syntax
https://www.javatpoint.com/kali-linux-basic-commands 5/16
11/9/24, 11:00 AM Kali Linux Basic Commands - javatpoint
# cat filename
8. mkdir Command
The 'mkdir' command is used to create directories. For example, if we wish to create a
directory named 'Penetration testing' under the 'Documents' directory, then we have to
open a terminal and enter the below command:
cd Documents
mkdir Penetration testing
9. rm Command
In Kali Linux, the 'rm' command is used to delete files. It can be used to delete directories
when we use them recursively.
The removal process separates a file name form its associated data in a file system and
identifies that space in the storage device as available for future writes. In other words,
when we erase a file. the data inside it remains unchanged, but it is no longer linked to a
filename.
https://www.javatpoint.com/kali-linux-basic-commands 6/16
11/9/24, 11:00 AM Kali Linux Basic Commands - javatpoint
10. mv Command
With the help of the 'mv' command, we can move or renames files and directories on our
file system.
Syntax
# uname
https://www.javatpoint.com/kali-linux-basic-commands 7/16
11/9/24, 11:00 AM Kali Linux Basic Commands - javatpoint
Use the -p command-line option if we merely want to know how long the system has been
up for and in a more human-readable format.
Syntax
# uptime
Syntax
# users
https://www.javatpoint.com/kali-linux-basic-commands 8/16
11/9/24, 11:00 AM Kali Linux Basic Commands - javatpoint
We can view any text file with the help of the "less" command simply by typing the
following command into a terminal window:
Syntax:
# less /etc/passwd
The 'more' command works with any applications that output to the screen. A good way to
test this is to type the following command into a terminal window:
Syntax:
https://www.javatpoint.com/kali-linux-basic-commands 9/16
11/9/24, 11:00 AM Kali Linux Basic Commands - javatpoint
# moreetc/passwd
16. vi Command
The 'vi' editor is a screen editor that comes with practically every UNIX system. The
command mode and the insert mode are the two most common nodes in vi.
In order to start entering text in an empty file, we have to first switch from the command
mode to the insert mode. To accomplish this, start typing the letter i. When we start typing,
anything then the type will be entered into the file.
Type some short lines, then press Return at the end of each. Vi does not use word wrap like
other word processors. It will break a line at the screen' edge. If we make a mistake, we can
undo it by pressing the Backspace key. If the Backspace key on our computer is not
working, then try the ctrl + h key combination.
https://www.javatpoint.com/kali-linux-basic-commands 10/16
11/9/24, 11:00 AM Kali Linux Basic Commands - javatpoint
Syntax:
# free
If we use the free command with the -t option, it would list the total line at the end.
https://www.javatpoint.com/kali-linux-basic-commands 11/16
11/9/24, 11:00 AM Kali Linux Basic Commands - javatpoint
Syntax:
We can reverse the order of any file's contents by using the -r sort.
Syntax
# sort -r
https://www.javatpoint.com/kali-linux-basic-commands 12/16
11/9/24, 11:00 AM Kali Linux Basic Commands - javatpoint
The 'history' command is one of Kali Linux's most commonly used commands. The history
command in the bash shell saves a history of commands entered that can be used to
repeat commands.
We can run the history command by itself, and it will just print the current user's bash
history on the screen, as shown below:
Syntax:
# history
https://www.javatpoint.com/kali-linux-basic-commands 13/16
11/9/24, 11:00 AM Kali Linux Basic Commands - javatpoint
← prev next →
Latest Courses
https://www.javatpoint.com/kali-linux-basic-commands 14/16
11/9/24, 11:00 AM Kali Linux Basic Commands - javatpoint
https://www.javatpoint.com/kali-linux-basic-commands 15/16
11/9/24, 11:00 AM Kali Linux Basic Commands - javatpoint
https://www.javatpoint.com/kali-linux-basic-commands 16/16