Essential Linux Commands Every DevOps Engineer Should Know - Part 1
Tags: devops, linux, tutorial
Published: 2023-02-27 13:31:19

<!-- wp:paragraph -->
<p>Linux is a powerful and versatile operating system that is widely used in many industries, including <a href="https://nerdleveltech.com/how-to-learn-programming-all-you-need-to-know-guide/" target="_blank" rel="noreferrer noopener">software development,</a> data analysis, and <a href="https://nerdleveltech.com/how-to-make-a-better-responsive-web-design-full-guide/" target="_blank" rel="noreferrer noopener">web hosting</a>. As a Linux engineer, it's important to have a good understanding of the essential Linux commands that can help you manage your systems and perform common daily tasks quickly. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Additionally, with the goal of increasing collaboration and streamlining processes between software development and IT operations teams, DevOps has become an integral part of successful software development projects. A key aspect of DevOps is the use of Linux, the open-source operating system that has become the backbone of many modern applications and software systems. For DevOps engineers, mastering Linux is critical to effectively managing and deploying software in a variety of environments.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">In this article, we'll explore some of the most important Linux commands you should know <a href="https://www.naukri.com/learning/articles/best-resources-to-learn-devops-in-depth/" target="_blank" rel="noreferrer noopener">as a DevOps engineer </a>or to use Linux efficiently. But first, let us learn what these signs mean in Linux and answer some common questions.</p>
<!-- /wp:paragraph -->

<!-- wp:image {"align":"center"} -->
<figure class="wp-block-image aligncenter"><img src="https://nerdleveltech.com/wp-content/uploads/1b7476e1-01ba-4af3-9373-aab91e2f8c3e.png" alt="bash, command-line, linux"/></figure>
<!-- /wp:image -->

<!-- wp:heading -->
<h2>What does $() do in Linux?</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>In Linux, <strong>$( )</strong> is a syntax for command substitution. It allows you to use the output of one command as an argument to another command or as part of a larger command. This is a powerful feature of Linux shell <a href="https://nerdleveltech.com/javascript-functions-why-theyre-essential-to-understand-easy-guide-part2/" target="_blank" rel="noreferrer noopener">scripting</a> that allows you to chain commands together and automate tasks.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">Here's an example of how <strong>$( )</strong> works:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ echo "Today is $(date)"</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">In this example, the <strong>$(date)</strong> command is substituted with the current date and time. The output of the <strong>date</strong> command is then used as an argument to the <strong>echo</strong> command, resulting in the following output:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>Today is Thu Feb 16 08:30:00 UTC 2023</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">You can also use command substitution to assign the output of a command to a <a href="https://nerdleveltech.com/javascript-functions-why-theyre-essential-to-understand-easy-guide/" target="_blank" rel="noreferrer noopener">variable</a>, like this:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ output=$(ls -l)</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">In this example, the <strong>$(ls -l)</strong> command is substituted with the output of the <strong>ls -l</strong> command, which is a list of files and directories in the current directory. The output is then assigned to the <strong>output</strong> variable.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">You can then use the <strong>output</strong> variable in another command or script, like this:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ echo "$output"</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">This will display the output of the <strong>ls -l</strong> command that was stored in the <strong>output</strong> variable.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>What does $ do in Linux?</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>The <strong>$</strong> symbol is used in various ways depending on the context. Here are a few common uses:</p>
<!-- /wp:paragraph -->

<!-- wp:list {"ordered":true} -->
<ol><!-- wp:list-item -->
<li><p>Prompt: In the Linux command line interface (CLI), the <strong>$</strong> symbol is often used to indicate the prompt, which is the point where the user enters commands.</p></li>
<!-- /wp:list-item --></ol>
<!-- /wp:list -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$</code></pre>
<!-- /wp:code -->

<!-- wp:list {"ordered":true} -->
<ol><!-- wp:list-item -->
<li><p>Variables: The <strong>$</strong> symbol is used to reference variables in shell scripts. When a variable is referenced, the <strong>$</strong> symbol is placed before the variable name. For example, if a variable named <strong>NAME</strong> contains the value "John", you can reference the variable like this:</p></li>
<!-- /wp:list-item --></ol>
<!-- /wp:list -->

<!-- wp:code -->
<pre class="wp-block-code"><code>echo $NAME</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">This will display the value of the <strong>NAME</strong> variable, which is "John".</p>
<!-- /wp:paragraph -->

<!-- wp:list {"ordered":true} -->
<ol><!-- wp:list-item -->
<li><p>Environment variables: In Linux, there are many predefined environment variables that contain system information or user preferences. These variables can be referenced using the <strong>$</strong> symbol. For example, the <strong>$HOME</strong> variable contains the path to the current user's home directory. You can reference the <strong>$HOME</strong> variable like this:</p></li>
<!-- /wp:list-item --></ol>
<!-- /wp:list -->

<!-- wp:code -->
<pre class="wp-block-code"><code>cd $HOME</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">This will change the current directory to the home directory of the current user.</p>
<!-- /wp:paragraph -->

<!-- wp:list {"ordered":true} -->
<ol><!-- wp:list-item -->
<li><p>Process ID: The <strong>$</strong> symbol followed by a number can be used to reference the process ID (PID) of a running process. For example, if you want to kill a process with a PID of 1234, you can use the <strong>kill</strong> command like this:</p></li>
<!-- /wp:list-item --></ol>
<!-- /wp:list -->

<!-- wp:code -->
<pre class="wp-block-code"><code>kill -9 $1234</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">This will send a signal to the process with the PID of 1234 to terminate it.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Now, Let us start with the most used commands.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"className":"has-text-align-left"} -->
<h2 class="has-text-align-left">System Information</h2>
<!-- /wp:heading -->

<!-- wp:heading {"level":3} -->
<h3>uname</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">The <strong>uname</strong> command is used to display information about the system, such as the kernel version and system architecture. You can use this command to check if you're running the latest version of the Linux kernel. Here's an example:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ uname -a
Linux myserver 5.10.0-8-amd64 #1 SMP Debian 5.10.46-4 (2021-07-03) x86_64 GNU/Linux</code></pre>
<!-- /wp:code -->

<!-- wp:heading {"level":3} -->
<h3>lsb_release</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>The <strong>lsb_release</strong> command displays Linux Standard Base (LSB) information about the distribution. This can be useful when you need to know the exact version of your Linux distribution. Here's an example:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.3 LTS
Release:        20.04
Codename:       focal</code></pre>
<!-- /wp:code -->

<!-- wp:heading {"level":3} -->
<h3>hostname</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>The <strong>hostname</strong> command is used to display or set the system's host name. The host name is a label that identifies the system in a network. By default, the host name is set during installation, but you can change it using the <strong>hostname</strong> command.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To display the current host name, run the command with no arguments:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ hostname
myhost</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph -->
<p><span data-color="rgb(247, 247, 248)" style="color: inherit">To set a new host name, use the </span><strong>-b</strong><span data-color="rgb(247, 247, 248)" style="color: inherit"> option followed by the new host name:</span></p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ sudo hostname -b newhost</code></pre>
<!-- /wp:code -->

<!-- wp:heading {"level":4,"className":"has-text-align-left"} -->
<h4 class="has-text-align-left">Tip</h4>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">You can add the new host name to the <strong>/etc/hosts</strong> file to make the change permanent.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3,"className":"has-text-align-left"} -->
<h3 class="has-text-align-left">top</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">The <strong>top</strong> command is used to display system process information and monitor system resources. It shows a real-time list of the processes running on the system and their resource usage, such as CPU and memory usage.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To launch the <strong>top</strong> command, simply type <strong>top</strong> in the terminal. The default view shows the processes sorted by the percentage of CPU usage:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ top</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">You can use various keys to interact with the <strong>top</strong> command. For example, you can press <strong>q</strong> to quit, <strong>k</strong> to kill a process, and <strong>f</strong> to change the displayed fields.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":4,"className":"has-text-align-left"} -->
<h4 class="has-text-align-left">Tip</h4>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To sort the processes by a specific field, press the corresponding key. For example, press <strong>P</strong> to sort by CPU usage, <strong>M</strong> to sort by memory usage, and <strong>T</strong> to sort by total CPU time.</p>
<!-- /wp:paragraph -->

<!-- wp:image {"align":"center"} -->
<figure class="wp-block-image aligncenter"><img src="https://nerdleveltech.com/wp-content/uploads/4887f6fb-4650-42b5-9819-c3e10da73f49.png" alt="linux, window, terminal"/></figure>
<!-- /wp:image -->

<!-- wp:heading -->
<h2>File and Directory Management</h2>
<!-- /wp:heading -->

<!-- wp:heading {"level":3,"className":"has-text-align-left"} -->
<h3 class="has-text-align-left">ls</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">The <strong>ls</strong> command is used to list the contents of a directory. By default, it lists the files and directories in the current working directory. You can also use it to list the contents of a specific directory by specifying the directory path as an argument. You can use the <strong>-l</strong> flag to get more detailed information about each file, such as the file size and permissions.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To list the contents of the current working directory, run the <strong>ls</strong> command with no arguments:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ ls
file1.txt file2.txt dir1</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To list the contents of a specific directory, specify the directory path as an argument:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ ls /home/user/documents
file1.txt file2.txt dir1</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To list the contents of a directory in long format, use the <strong>-l</strong> flag:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ ls -l
-rw-r--r-- 1 user user 15 Sep 24 16:25 file1.txt
-rw-r--r-- 1 user user 23 Sep 24 16:26 file2.txt
drwxr-xr-x 2 user user  6 Sep 24 16:27 dir1</code></pre>
<!-- /wp:code -->

<!-- wp:heading {"level":3,"className":"has-text-align-left"} -->
<h3 class="has-text-align-left">cd</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">The <strong>cd</strong> command is used to change the current working directory. You can use it to navigate the file system.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To change the current working directory to a specific directory, specify the directory path as an argument:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ cd /home/user/documents</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To change to the parent directory, use <strong>cd ..</strong>:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ cd ..</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To change to the home directory, use <strong>cd</strong> with no arguments:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ cd</code></pre>
<!-- /wp:code -->

<!-- wp:heading {"level":3,"className":"has-text-align-left"} -->
<h3 class="has-text-align-left">mkdir</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">The <strong>mkdir</strong> command is used to create a new directory.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To create a new directory in the current working directory, specify the directory name as an argument:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ mkdir newdir</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To create a new directory with multiple levels of subdirectories, use the <strong>-p</strong> flag:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ mkdir -p newdir/subdir1/subdir2</code></pre>
<!-- /wp:code -->

<!-- wp:heading {"level":3,"className":"has-text-align-left"} -->
<h3 class="has-text-align-left">rmdir</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">The <strong>rmdir</strong> command is used to remove a directory.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To remove an empty directory, specify the directory name as an argument:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ rmdir newdir</code></pre>
<!-- /wp:code -->

<!-- wp:heading {"level":3,"className":"has-text-align-left"} -->
<h3 class="has-text-align-left">touch</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">The <strong>touch</strong> command is used to create a new file or update the modification time of an existing file.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To create a new file in the current working directory, specify the file name as an argument:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ touch newfile.txt</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To update the modification time of an existing file, specify the file name as an argument:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ touch existingfile.txt</code></pre>
<!-- /wp:code -->

<!-- wp:heading {"level":3,"className":"has-text-align-left"} -->
<h3 class="has-text-align-left">rm</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">The <strong>rm</strong> command is used to remove files.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To remove a file, specify the file name as an argument:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ rm file.txt</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To remove multiple files, specify the file names as arguments separated by spaces:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ rm file1.txt file2.txt</code></pre>
<!-- /wp:code -->

<!-- wp:heading {"level":3,"className":"has-text-align-left"} -->
<h3 class="has-text-align-left">cp</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">The <strong>cp</strong> command is used to copy files or directories.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To copy a file to a new location, specify the source file and the destination directory as arguments:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ cp file1.txt /home/user/documents</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To copy a directory and all its contents to a new location, use the <strong>-r</strong> flag:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ cp -r dir1 /home/user/documents</code></pre>
<!-- /wp:code -->

<!-- wp:heading {"level":3,"className":"has-text-align-left"} -->
<h3 class="has-text-align-left">mv</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">The <strong>mv</strong> command is used to move or rename files or directories.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>To move a file to a new location, specify the source file and the destination directory as arguments:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ mv file1.txt /home/user/documents</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To rename a file, specify the old file name and the new file name as arguments:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ mv oldfile.txt newfile.txt</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To move a directory and all its contents to a new location, use the <strong>-r</strong> flag:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ mv -r dir1 /home/user/documents</code></pre>
<!-- /wp:code -->

<!-- wp:heading {"level":4,"className":"has-text-align-left"} -->
<h4 class="has-text-align-left">Tip</h4>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">Be careful when using the <strong>rm</strong> command, as it can permanently delete files and directories without confirmation. Always double-check the list of files you're about to delete before running the command.</p>
<!-- /wp:paragraph -->

<!-- wp:image {"align":"center"} -->
<figure class="wp-block-image aligncenter"><img src="https://nerdleveltech.com/wp-content/uploads/756a7ec0-fc6b-40dd-bef6-baa9a5480016.png" alt="penguin, tux, animal"/></figure>
<!-- /wp:image -->

<!-- wp:heading -->
<h2>System Maintenance</h2>
<!-- /wp:heading -->

<!-- wp:heading {"level":3,"className":"has-text-align-left"} -->
<h3 class="has-text-align-left">reboot</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">The <strong>reboot</strong> command is used to restart the system.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To restart the system, simply run the <strong>reboot</strong> command:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ sudo reboot</code></pre>
<!-- /wp:code -->

<!-- wp:heading {"level":4,"className":"has-text-align-left"} -->
<h4 class="has-text-align-left">Tip</h4>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">Before running the <strong>reboot</strong> command, make sure to save any unsaved work and close any running applications.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3,"className":"has-text-align-left"} -->
<h3 class="has-text-align-left">shutdown</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">The <strong>shutdown</strong> command is used to shut down the system.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To shut down the system, simply run the <strong>shutdown</strong> command with the <strong>-h</strong> flag:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ sudo shutdown -h now</code></pre>
<!-- /wp:code -->

<!-- wp:heading {"level":4,"className":"has-text-align-left"} -->
<h4 class="has-text-align-left">Tip</h4>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">Before running the <strong>shutdown</strong> command, make sure to save any unsaved work and close any running applications.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3,"className":"has-text-align-left"} -->
<h3 class="has-text-align-left">df</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">The <strong>df</strong> command is used to show disk space usage. It displays the file system usage for all mounted file systems.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To display the disk space usage, run the <strong>df</strong> command with no arguments:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ df
Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/sda1      492670736 2979884 462082592   1% /
tmpfs           16383224       0  16383224   0% /dev/shm
...
</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">You can use the <strong>-h</strong> flag to display the sizes in a human-readable format:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1       471G  2.9G  441G   1% /
tmpfs            16G     0   16G   0% /dev/shm
...
</code></pre>
<!-- /wp:code -->

<!-- wp:heading {"level":3,"className":"has-text-align-left"} -->
<h3 class="has-text-align-left">du</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">The <strong>du</strong> command is used to show disk usage of a file or directory.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To display the disk usage of a file or directory, run the <strong>du</strong> command followed by the file or directory path:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ du /home/user/documents
784     /home/user/documents/dir1/subdir1
200     /home/user/documents/dir1/subdir2
1024    /home/user/documents/dir1
15      /home/user/documents/file1.txt
23      /home/user/documents/file2.txt
1863    /home/user/documents</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start"> sizes in a human-readable format:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ du -h /home/user/documents
784K    /home/user/documents/dir1/subdir1
200K    /home/user/documents/dir1/subdir2
1.1M    /home/user/documents/dir1
15K     /home/user/documents/file1.txt
23K     /home/user/documents/file2.txt
1.9M    /home/user/documents</code></pre>
<!-- /wp:code -->

<!-- wp:heading {"level":3,"className":"has-text-align-left"} -->
<h3 class="has-text-align-left">ps</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">The <strong>ps</strong> command is used to show the current processes running on the system.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To display the current processes, run the <strong>ps</strong> command:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ ps
  PID TTY          TIME CMD
 2713 pts/0    00:00:00 bash
 2824 pts/0    00:00:00 ps</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">You can use the <strong>-aux</strong> flag to display all the processes in a full format:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ ps -aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
user      2713  0.0  0.1  25572  6860 pts/0    Ss   11:42   0:00 bash
user      2825  0.</code></pre>
<!-- /wp:code -->

<!-- wp:heading {"level":3,"className":"has-text-align-left"} -->
<h3 class="has-text-align-left">kill</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">The <strong>kill</strong> command is used to send a signal to a process to terminate it.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To kill a process, you first need to identify its process ID (PID) using the <strong>ps</strong> command. Then, you can use the <strong>kill</strong> command with the PID as an argument:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ ps aux | grep processname
user      1234  0.0  0.1  25572  6860 pts/0    Ss   11:42   0:00 processname

$ sudo kill 1234</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">You can also use the <strong>pkill</strong> command to kill a process by its name:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ pkill processname</code></pre>
<!-- /wp:code -->

<!-- wp:heading {"level":4,"className":"has-text-align-left"} -->
<h4 class="has-text-align-left">Tip</h4>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">When killing a process, use the <strong>kill -9</strong> command if the process is not responding to the regular <strong>kill</strong> command.</p>
<!-- /wp:paragraph -->

<!-- wp:image {"align":"center"} -->
<figure class="wp-block-image aligncenter"><img src="https://nerdleveltech.com/wp-content/uploads/1fdd1288-27d0-40b1-bf0c-a20b4ea80017.png" alt="linux, tux, administrator"/></figure>
<!-- /wp:image -->

<!-- wp:heading -->
<h2>User and Group Management</h2>
<!-- /wp:heading -->

<!-- wp:heading {"level":3,"className":"has-text-align-left"} -->
<h3 class="has-text-align-left">useradd</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">The <strong>useradd</strong> command is used to create a new user account.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To create a new user account, run the <strong>useradd</strong> command followed by the desired username:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ sudo useradd username</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">You can also specify additional options, such as the home directory and login shell:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ sudo useradd -m -s /bin/bash username</code></pre>
<!-- /wp:code -->

<!-- wp:heading {"level":3,"className":"has-text-align-left"} -->
<h3 class="has-text-align-left">usermod</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">The <strong>usermod</strong> command is used to modify an existing user account.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To modify an existing user account, run the <strong>usermod</strong> command followed by the desired options and username:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ sudo usermod -d /new/home/dir -s /bin/zsh username</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">You can use various options to modify different attributes of the user account, such as the home directory, login shell, and group membership.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3,"className":"has-text-align-left"} -->
<h3 class="has-text-align-left">userdel</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">The <strong>userdel</strong> command is used to delete an existing user account.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To delete an existing user account, run the <strong>userdel</strong> command followed by the username:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ sudo userdel username</code></pre>
<!-- /wp:code -->

<!-- wp:heading {"level":3,"className":"has-text-align-left"} -->
<h3 class="has-text-align-left">passwd</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">The <strong>passwd</strong> command is used to set or change the password for a user account.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To set or change the password for a user account, run the <strong>passwd</strong> command followed by the username:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ sudo passwd username</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">You will be prompted to enter the new password and then confirm it.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3,"className":"has-text-align-left"} -->
<h3 class="has-text-align-left">groupadd</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">The <strong>groupadd</strong> command is used to create a new group.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To create a new group, run the <strong>groupadd</strong> command followed by the desired group name:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ sudo groupadd groupname</code></pre>
<!-- /wp:code -->

<!-- wp:heading {"level":3,"className":"has-text-align-left"} -->
<h3 class="has-text-align-left">groupmod</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">The <strong>groupmod</strong> command is used to modify an existing group.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To modify an existing group, run the <strong>groupmod</strong> command followed by the desired options and group name:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ sudo groupmod -n newgroupname groupname</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">You can use various options to modify different attributes of the group, such as the group name.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3,"className":"has-text-align-left"} -->
<h3 class="has-text-align-left">groupdel</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">The <strong>groupdel</strong> command is used to delete an existing group.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To delete an existing group, run the <strong>groupdel</strong> command followed by the group name:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ sudo groupdel groupname</code></pre>
<!-- /wp:code -->

<!-- wp:heading {"level":4,"className":"has-text-align-left"} -->
<h4 class="has-text-align-left">Tip</h4>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">When adding or modifying a user account, make sure to assign the user to the appropriate group to grant the appropriate permissions.</p>
<!-- /wp:paragraph -->

<!-- wp:image {"align":"center"} -->
<figure class="wp-block-image aligncenter"><img src="https://nerdleveltech.com/wp-content/uploads/8b47dce8-9c6f-4eec-ae4a-7c4d2fa9abb9.png" alt="tux, penguin, animal"/></figure>
<!-- /wp:image -->

<!-- wp:heading -->
<h2>Package Management</h2>
<!-- /wp:heading -->

<!-- wp:heading {"level":3,"className":"has-text-align-left"} -->
<h3 class="has-text-align-left">apt-get</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">The <strong>apt-get</strong> command is used for package management on Debian-based systems.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To install a package using <strong>apt-get</strong>, run the command followed by the package name:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ sudo apt-get install packagename</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To remove a package using <strong>apt-get</strong>, run the command followed by the package name:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ sudo apt-get remove packagename</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To update the package list using <strong>apt-get</strong>, run the command with the <strong>update</strong> option:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ sudo apt-get update</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To upgrade all installed packages using <strong>apt-get</strong>, run the command with the <strong>upgrade</strong> option:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ sudo apt-get upgrade</code></pre>
<!-- /wp:code -->

<!-- wp:heading {"level":3,"className":"has-text-align-left"} -->
<h3 class="has-text-align-left">yum</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">The <strong>yum</strong> command is used for package management on Red Hat-based systems.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To install a package using <strong>yum</strong>, run the command followed by the package name:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ sudo yum install packagename</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To remove a package using <strong>yum</strong>, run the command followed by the package name:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ sudo yum remove packagename</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To update the package list using <strong>yum</strong>, run the command with the <strong>update</strong> option:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ sudo yum update</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To upgrade all installed packages using <strong>yum</strong>, run the command with the <strong>upgrade</strong> option:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ sudo yum upgrade</code></pre>
<!-- /wp:code -->

<!-- wp:heading {"level":3,"className":"has-text-align-left"} -->
<h3 class="has-text-align-left">dpkg</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">The <strong>dpkg</strong> command is used for package management on Debian-based systems.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To install a package using <strong>dpkg</strong>, run the command followed by the package name:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ sudo dpkg -i packagename.deb</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To remove a package using <strong>dpkg</strong>, run the command followed by the package name:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ sudo dpkg -r packagename</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To list all installed packages using <strong>dpkg</strong>, run the command with the <strong>-l</strong> option:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ sudo dpkg -l</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To search for a package using <strong>dpkg</strong>, run the command followed by the package name:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ sudo dpkg -s packagename</code></pre>
<!-- /wp:code -->

<!-- wp:heading {"level":4,"className":"has-text-align-left"} -->
<h4 class="has-text-align-left">Tip</h4>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">When managing packages, make sure to only install packages from trusted sources to avoid potential security risks.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3,"className":"has-text-align-left"} -->
<h3 class="has-text-align-left">pacman</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">The <strong>pacman</strong> command is used for package management on Arch Linux systems.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To install a package using <strong>pacman</strong>, run the command followed by the package name:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ sudo pacman -S packagename</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To remove a package using <strong>pacman</strong>, run the command followed by the package name:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ sudo pacman -R packagename</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To update the package list using <strong>pacman</strong>, run the command with the <strong>-Sy</strong> options:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ sudo pacman -Sy</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To upgrade all installed packages using <strong>pacman</strong>, run the command with the <strong>-Syu</strong> options:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ sudo pacman -Syu</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To search for a package using <strong>pacman</strong>, run the command followed by the search term:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ sudo pacman -Ss searchterm</code></pre>
<!-- /wp:code -->

<!-- wp:heading {"level":4,"className":"has-text-align-left"} -->
<h4 class="has-text-align-left">Tip</h4>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">When managing packages, make sure to only install packages from trusted sources to avoid potential security risks.</p>
<!-- /wp:paragraph -->

<!-- wp:image {"align":"center"} -->
<figure class="wp-block-image aligncenter"><img src="https://nerdleveltech.com/wp-content/uploads/fdbaa025-234f-452a-ba67-68704328c006.png" alt="tux, penguin, linux"/></figure>
<!-- /wp:image -->

<!-- wp:heading -->
<h2>Text Editors</h2>
<!-- /wp:heading -->

<!-- wp:heading {"level":3,"className":"has-text-align-left"} -->
<h3 class="has-text-align-left">nano</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start"><strong>nano</strong> is a simple text editor for the terminal. It is easy to use and requires no prior knowledge of command-line text editors.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To open a file in <strong>nano</strong>, simply run the command followed by the file name:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ nano filename</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">You can then use the keyboard to edit the file. Press <strong>Ctrl + X</strong> to save and exit the file.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3,"className":"has-text-align-left"} -->
<h3 class="has-text-align-left">vim</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start"><strong>vim</strong> is a powerful text editor that can be used in the terminal or in a GUI. It is a modal editor, which means it has different modes for editing and navigation.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To open a file in <strong>vim</strong>, simply run the command followed by the file name:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ vim filename</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">You can then use the keyboard to edit the file. Press <strong>Esc</strong> to enter command mode, and <strong>i</strong> to enter insert mode. To save and exit the file, type <strong>:wq</strong> and press Enter.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3,"className":"has-text-align-left"} -->
<h3 class="has-text-align-left">emacs</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start"><strong>emacs</strong> is another powerful text editor with extensive customization options. It is also a modal editor, but with a different set of modes than <strong>vim</strong>.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To open a file in <strong>emacs</strong>, simply run the command followed by the file name:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ emacs filename</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">You can then use the keyboard to edit the file. Press <strong>Ctrl + X</strong> followed by <strong>Ctrl + S</strong> to save the file, and <strong>Ctrl + X</strong> followed by <strong>Ctrl + C</strong> to exit Emacs.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":4,"className":"has-text-align-left"} -->
<h4 class="has-text-align-left">Tip</h4>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">When using <strong>vim</strong> or <strong>emacs</strong>, it can be helpful to learn some of the basic keyboard shortcuts to increase your efficiency.</p>
<!-- /wp:paragraph -->

<!-- wp:image {"align":"center"} -->
<figure class="wp-block-image aligncenter"><img src="https://nerdleveltech.com/wp-content/uploads/ec752b50-4926-4f1b-9ec2-ae9a4fe081eb.png" alt="background, security, linux"/></figure>
<!-- /wp:image -->

<!-- wp:heading -->
<h2>Network Management</h2>
<!-- /wp:heading -->

<!-- wp:heading {"level":3,"className":"has-text-align-left"} -->
<h3 class="has-text-align-left">ifconfig</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start"><strong>ifconfig</strong> is a command-line tool used to show information about network interfaces on a Linux system.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To display information about all network interfaces, simply run the command without any options:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ ifconfig</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">You can then see information such as the IP address, netmask, and MAC address of each interface.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3,"className":"has-text-align-left"} -->
<h3 class="has-text-align-left">ip (don't work for mac)</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start"><strong>ip</strong> is a more modern tool used to show and configure network interfaces and routing tables on a Linux system. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To display information about all network interfaces, run the command with the <strong>address</strong> option:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ ip address</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">You can then see information such as the IP address, netmask, and MAC address of each interface. </p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3,"className":"has-text-align-left"} -->
<h3 class="has-text-align-left">netstat</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start"><strong>netstat</strong> is a command-line tool used to display network connections, routing tables, and network interface statistics on a Linux system.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To display all open network connections, run the command with the <strong>a</strong> and <strong>n</strong> options:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ netstat -an</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">You can then see information such as the protocol, local address, foreign address, and state of each connection.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3,"className":"has-text-align-left"} -->
<h3 class="has-text-align-left">ping</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start"><strong>ping</strong> is a command-line tool used to test network connectivity to a host by sending ICMP echo request packets and waiting for ICMP echo reply packets.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To test network connectivity to a host, run the command followed by the host name or IP address:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ ping hostname</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">You can then see information such as the number of packets sent and received, and the round-trip time for each packet.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3,"className":"has-text-align-left"} -->
<h3 class="has-text-align-left">traceroute</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start"><strong>traceroute</strong> is a command-line tool used to show the path that packets take to reach a destination host.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To show the path to a destination host, run the command followed by the host name or IP address:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ traceroute hostname</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">You can then see information such as the IP addresses and round-trip times for each hop along the path.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3,"className":"has-text-align-left"} -->
<h3 class="has-text-align-left">nslookup</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start"><strong>nslookup</strong> is a command-line tool used to query the DNS (Domain Name System) to obtain information about a domain or hostname.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To look up the IP address of a domain or hostname, run the command followed by the domain or hostname:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ nslookup domainname</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">You can then see information such as the IP address and DNS server used for the lookup.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3,"className":"has-text-align-left"} -->
<h3 class="has-text-align-left">dig</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start"><strong>dig</strong> is a command-line tool similar to <strong>nslookup</strong> that is used to query the DNS to obtain information about a domain or hostname.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To look up the IP address of a domain or hostname, run the command followed by the domain or hostname:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ dig domainname</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">You can then see information such as the IP address and DNS server used for the lookup.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3,"className":"has-text-align-left"} -->
<h3 class="has-text-align-left">ifup and ifdown</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start"><strong>ifup</strong> and <strong>ifdown</strong> are command-line tools used to bring up or take down a network interface on a Linux system.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To bring up a network interface, run the <strong>ifup</strong> command followed by the interface name:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ sudo ifup interfacename</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To take down a network interface, run the <strong>ifdown</strong> command followed by the interface name:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ sudo ifdown interfacename</code></pre>
<!-- /wp:code -->

<!-- wp:heading {"level":3,"className":"has-text-align-left"} -->
<h3 class="has-text-align-left">route</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start"><strong>route</strong> is a command-line tool used to view and configure the routing table on a Linux system.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To display the current routing table, run the command with the <strong>-n</strong> option:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ route -n</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">You can then see information such as the destination network, gateway, and interface for each route.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3,"className":"has-text-align-left"} -->
<h3 class="has-text-align-left">iptables</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start"><strong>iptables</strong> is a command-line tool used to configure the Linux kernel's firewall rules. It can be used to block or allow incoming or outgoing network traffic based on a variety of criteria.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">To view the current firewall rules, run the command with the <strong>-L</strong> option:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>$ sudo iptables -L</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">You can then see information such as the chain, target, and protocol for each rule.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":4,"className":"has-text-align-left"} -->
<h4 class="has-text-align-left">Tip</h4>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">When managing network connections, use a combination of these tools to diagnose and troubleshoot network issues.</p>
<!-- /wp:paragraph -->

<!-- wp:image {"align":"center"} -->
<figure class="wp-block-image aligncenter"><img src="https://nerdleveltech.com/wp-content/uploads/78c6f196-11e9-4d87-a757-f89b5d273978.png" alt="quill, pen, write"/></figure>
<!-- /wp:image -->

<!-- wp:heading -->
<h2>Conclusion:</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>learning Linux is critical for any engineer or technical professional, regardless of their specific field. Here are a few reasons why:</p>
<!-- /wp:paragraph -->

<!-- wp:list {"ordered":true} -->
<ol><!-- wp:list-item -->
<li><p>Linux is widely used in the industry: Linux is one of the most widely used operating systems in the tech industry, particularly in server and <a href="https://nerdleveltech.com/cloud-computing-what-are-its-benefits-and-risks/" target="_blank" rel="noreferrer noopener">cloud environments</a>. Learning Linux can give you a strong foundation in the skills and tools used by many companies and organizations.</p></li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li><p>Linux is open-source: Linux is open-source software, which means that its source code is freely available to anyone. This allows developers and engineers to modify, improve, and extend the operating system to suit their specific needs.</p></li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li><p>Linux is highly customizable: Linux is highly customizable and can be configured to suit a wide range of use cases. This makes it a popular choice for developers and engineers who need to build custom solutions for their organizations.</p></li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li><p>Linux offers a powerful command-line interface: Linux is well-known for its powerful command-line interface, which provides a high degree of control and flexibility for users. This can be particularly useful for engineers who need to automate tasks, manage networks, or work with servers.</p></li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li><p>Linux skills are in high demand: Linux skills are in high demand in the tech industry, particularly in fields like cloud computing, network administration, and software development. By learning Linux, you can increase your career opportunities and earning potential.</p></li>
<!-- /wp:list-item --></ol>
<!-- /wp:list -->

<!-- wp:paragraph {"align":"start","className":"has-text-align-start"} -->
<p class="has-text-align-start">In summary, learning Linux can provide a strong foundation in the skills and tools used by many organizations in the tech industry. Its open-source nature, customizability, and powerful command-line interface make it a popular choice for developers and engineers. With the high demand for Linux skills in the tech industry, learning Linux can also provide significant career benefits.</p>
<!-- /wp:paragraph -->