Basic operations with Kali Linux(PART3)

bob218
5 min readAug 22, 2023

--

of bob218

What is Linux? Everything You Need to Know (2023) (softwarelab.org)

22-The ping command is one of the most used commands in Linux for checking whether a network or a server is reachable. In addition, it is used to troubleshoot various connectivity issues. Here’s the general format:

ping [option] [hostname_or_IP_address]

For example, you want to know whether you can connect to Google and measure its response time:

ping google.com

23-The Linux command line lets you download files from the internet using the wget command. It works in the background without hindering other running processes.

The wget command retrieves files using HTTP, HTTPS, and FTP protocols. It can perform recursive downloads, which transfer website parts by following directory structures and links, creating local versions of the web pages. To use it, enter the following command:

wget [option] [url]

For example, enter the following command to download the latest version of WordPress:

wget https://wordpress.org/latest.zip

24-The uname or unix name command will print detailed information about your Linux system and hardware. This includes the machine name, operating system, and kernel. To run this command, simply enter uname into your CLI. Here’s the basic syntax:

uname [option]

These are the acceptable options to use:

-a prints all the system information.

-s prints the kernel name.

-n prints the system’s node hostname.

25-The top command in Linux Terminal will display all the running processes and a dynamic real-time view of the current system. It sums up the resource utilization, from CPU to memory usage.

The top command can also help you identify and terminate a process that may use too many system resources.

To run the command, simply enter top into the CLI.

26-With history, the system will list up to 500 previously executed commands, allowing you to reuse them without re-entering. Keep in mind that only users with sudo privileges can execute this command. How this utility runs also depends on which Linux shell you use. To run it, enter the command below:

history [option]

This command supports many options, such as:

-c clears the complete history list.
-d offset deletes the history entry at the OFFSET position.
-a appends history lines.

27-The echo command is a built-in utility that displays a line of text or string using the standard output. Here’s the basic syntax:

echo [option] [string]

For example, you can display the text Hostinger Tutorials by entering:

echo "Hostinger Tutorials"

This command supports many options, such as:

-n displays the output without the trailing newline.
-e enables the interpretation of the following backslash escapes:
\a plays sound alert.
\b removes spaces in between a text.
\c produces no further output.
-E displays the default option and disables the interpretation of backslash escapes.

28-Use the zip command to compress your files into a ZIP file, a universal format commonly used on Linux. It can automatically choose the best compression ratio.

The zip command is also useful for archiving files and directories and reducing disk usage. To use it, enter the following syntax:

zip [options] zipfile file1 file2….

For example, you have a file named note.txt that you want to compress into archive.zip in the current directory:

zip archive.zip note.txt

On the other hand, the unzip command extracts the zipped files from an archive. Here’s the general format:

unzip [option] file_name.zip

So, to unzip a file called archive.zip in the current directory, enter:

unzip archive.zip

29-Run the hostname command to know the system’s hostname. You can execute it with or without an option. Here’s the general syntax:

hostname [option]

There are many optional flags to use, including:

-a or –alias displays the hostname’s alias.
-A or –all-fqdns displays the machine’s Fully Qualified Domain Name (FQDN).
-i or –ip-address displays the machine’s IP address.
For example, enter the following command to know your computer’s IP address:

hostname -i

30-Linux is a multi-user system, meaning more than one person can use it simultaneously. useradd is used to create a new account, while the passwd command allows you to add a password. Only those with root privileges or sudo can run the useradd command.

When you use the useradd command, it performs some major changes:

>Edits the /etc/passwd, /etc/shadow, /etc/group, and /etc/gshadow files for the newly created accounts.
>Creates and populates a home directory for the user.
>Sets file permissions and ownerships to the home directory.
Here’s the basic syntax:

useradd [option] username

To set the password:

passwd the_password_combination

For example, to add a new person named John, enter the following command simultaneously:

useradd John
passwd 123456789

To delete a user account, use the userdel command:

userdel username

31-apt-get is a command line tool for handling Advanced Package Tool (APT) libraries in Linux. It lets you retrieve information and bundles from authenticated sources to manage, update, remove, and install software and its dependencies. Running the apt-get command requires you to use sudo or root privileges. Here’s the main syntax:

apt-get [options] (command)

These are the most common commands you can add to apt-get:

> update synchronizes the package files from their sources.

> upgrade installs the latest version of all installed packages.

> check updates the package cache and checks broken dependencies.

32-Linux allows users to edit and manage files via a text editor, such as nano, vi, or jed. nano and vi come with the operating system, while jed has to be installed.

The nano command denotes keywords and can work with most languages. To use it, enter the following command:

nano [filename]

vi uses two operating modes to work — insert and command. insert is used to edit and create a text file. On the other hand, the command performs operations, such as saving, opening, copying, and pasting a file. To use vi on a file, enter:

vi [filename]

jed has a drop-down menu interface that allows users to perform actions without entering keyboard combinations or commands. Like vi, it has modes to load modules or plugins to write specific texts.

To open the program, simply enter jed to the command line.

33-The htop command is an interactive program that monitors system resources and server processes in real time. It is available on most Linux distributions, and you can install it using the default package manager.

Compared to the top command, htop has many improvements and additional features, such as mouse operation and visual indicators. To use it, run the following command:

htop [options]

You can also add options, such as:

-d or –delay shows the delay between updates in tenths of seconds.
-C or –no-color enables the monochrome mode.
-h or –help displays the help message and exit.

34-The process status or ps command produces a snapshot of all running processes in your system. Executing the ps command without an option or argument will list the running processes in the shell along with:

> The unique process ID (PID)

> The type of the terminal (TTY)

> The running time (TIME)

> The command that launches the process (CMD)

Here are some acceptable options you can use:

-T displays all processes associated with the current shell session.

-u username lists processes associated with a specific user.

-A or -e shows all the running processes.

PS: I hope this content was useful and thank you for reading:)

💻 Follow me
👏 Give the article 50 claps
📚
Read more articles on Medium
🔗 Connect on social media
Github | Kaggle

--

--

bob218
bob218

No responses yet