EX.NO.
2 BASIC COMMANDS IN KALI LINUX
Aim
To understand and utilize the basic commands in Kali Linux.
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
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
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.Usually, we use the cat
command to display the content of a file.
Syntax
# 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.
10. mv Command
With the help of the 'mv' command, we can move or renames files and directories
on our file system.
11. uname Command
The 'uname' command displays the current system's information. We can view
system information about our Linux environment with the uname command in
Linux. With the uname -a command, we can learn more about our system,
including Kernel Name, Node Name, Kernel Release, Kernel Version,
Hardware Platform, Processor, and Operating System.
Syntax
# uname
12. uptime Command
The 'uptime' command displays the amount of time the system has been running.
Uptime's basic usage is simple: simply type the name of the command and
click Enter.
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
Result:
Thus successfully practiced basic commands in kali linux.