What is Kali Linux?
Kali Linux is an open source operating system. All system hardware and resources, such as CPU, memory, and storage, are directly managed by the operating system. Kali Linux is similar to Unix, but Kali Linux can work on a large number of devices, from mobiles to supercomputers. Linux includes:
- Kernel: It is the base component of any operating system. It manages system resources and makes users communicate with hardware by using Kali Linux commands.
- System userspace: It contains all the codes of the applications that the user interacts with.
- Applications: It consists of all the utilities and software that are used while working. They can be accessed by using Kali Linux commands.
Why do we need Kali Linux?
Kali Linux is primarily used by ethical hackers. It contains hundreds of cyber security tools and applications for various information security tasks such as penetration testing, forensics, and reverse engineering. The following are a few more reasons to use Kali Linux:
Free open-source operating system
Kali Linux is free of charge and anyone can download and use this operating system.
The code is written in English but it includes multilingual support that allows non-English-speaking users to locate and use the tools and applications easily.
Wireless device support
Kali Linux is built with a wide range of wireless supports so that it can run on a wide variety of devices.
Kali Linux can be customized according to the user, from the user interface to kernel level.
Enroll in our CEH Training if you want to learn more about Kali Linux and to master hacking!
20 Basic Kali Linux Commands
Now let us see the top Kali Linux commands that are most commonly used in the cyber security domain.
It displays the user manual for all commands in Kali Linux. It includes Bash command and detailed synopsis with a short description.
$man [option] …[command name]...
Let us take an example.
man ls: t will display the documentation of ls command
This command is used to change the directory that you are working in.
$cd [options] directory]
$cd Desktop: This command will navigate your present working directory to Desktop.
This command displays all the files and folders in a given directory.
ls [options]... [files]...
ls Desktop: This shows all the folders and files in the Desktop directory.
Check out the installation of Kali Linux and the basic Kali Linux commands
This command reads the contents of all files that are in a terminal.
$cat [options].... [filename(s)]..
You have a text.txt file that has some information in it; type: $cat text.txt
This commands creates new files without writing any content in it.
$touch [Option].. [Filename]..
Example: Let us create a file with a text name.
$ touch test1.txt
Preparing for a job interview? Head to our blog on Ethical Hacking interview questions and learn more.
This command will create a new directory in the present working directory.
$mkdir [Option].. <Directory Name>..
Example: We are in the Desktop directory; let us create a test folder in it.
It stands for print working directory. As the name suggests, it shows you the working directory that you are working in.
Example: Now, we are in the test folder. So type: $pwd
Get 100% Hike!
Master Most in Demand Skills Now !
This command displays any text as arguments. It is used for debugging shell programs.
$echo [Option] [String]
Example: $ echo -e “Welcome \nto \nKali”
This command is used to remove or delete any directory.
$rm [Option] [File]
Example: We are working in a test directory.
Check out our blog on basic Linux commands for Devops!
This command deletes or removes empty directories.
$rmdir [Option] [Directory_Name]
$ rmdir <Directory_Name>
This command downloads applications and web pages directly from the web.
$wget [Option] [URL]
This command can do two things; it can either rename the file or directory or it can move files from one folder to another.
$mv [Source] [Destination]
$ mv <Initial_Filename> <New_Filename>
This command copies files from one location to another.
$cp [Options] [Source].. [Destination]
Example: We have 2 files text1 and text2
$cp test1.txt test2.txt
This command shows the list of contents from a director in the tree fashion.
This command searches files and prints lines that match patterns.
$grep [Options] [Pattern] [Filename]
Example: We have a text1.txt file. $ grep -i <pattern> <filename>
This command allows the users to edit the text in the Vim editor.
$vi [Options] [Filename]
Example: $ vi <filename>
This command prints the first given number of lines from a file.
$head [Option] [Filename]
Example: We have a text.txt file. We print the first two lines.
$ head -n <number> <Filename>
Head to our Ethical Hacking tutorial to learn all about ethical hacking from scratch.
This command prints the last given number of lines from a file.
$head [Option] [Filename]
Example: We have a text.txt file. We print the last two lines.
$ tail -n <number> <Filename>
wc stands for word count. It shows the number of lines, words, characters, and bytes.
$wc [Option].. [File]..
Example: In the text file, we use wc Kali Linux command.
$ wc <Filename>
This command shows the history of all the commands that you have typed and executed in the terminal.
Example: Let’s type: $ history
Caught up with doubts? Head to our Cyber Security Community and ask them out.