{"id":12765,"date":"2024-05-28T02:09:00","date_gmt":"2024-05-27T20:39:00","guid":{"rendered":"https:\/\/www.wpoven.com\/blog\/?p=12765"},"modified":"2024-07-10T12:16:25","modified_gmt":"2024-07-10T06:46:25","slug":"linux-commands","status":"publish","type":"post","link":"https:\/\/www.wpoven.com\/blog\/linux-commands\/","title":{"rendered":"35 Best Linux Commands For Beginners"},"content":{"rendered":"\n<p>It would be an interesting thing for you to know that Linux has merely a 2% share in the global market of operating systems. But you will be surprised to know that more than 90% of the global cloud computing and web hosting services use Linux operating system. And it is highly popular among developers and professionals. <\/p>\n\n\n\n<p>Hence, it becomes essential for any beginner or individual who is into IT must be familiar with some basic Linux commands. <\/p>\n\n\n\n<p>It is also a misconception about Linux that it is one of the most complicated and tough operating systems that are exclusively available for Developers which is not true. So, in this post, we try to bring all the important information regarding Linux such as its true meaning, how it works, how it is different from other existing popular operating system and try to clear all the misconceptions about Linux that you might hear.<\/p>\n\n\n\n\n\n<h2 class=\"wp-block-heading\">What is Linux?<\/h2>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"562\" height=\"677\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_5-1.png\" alt=\"\" class=\"wp-image-12772\" srcset=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_5-1.png 562w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_5-1-249x300.png 249w\" sizes=\"(max-width: 562px) 100vw, 562px\" title=\"\"><\/figure><\/div>\n\n\n<p>Launched in the year 1991, <a href=\"https:\/\/www.linux.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">Linux<\/a> is a collection of open-source Unix operating systems such as Ubuntu, Devian, Mint, etc. that are developed on the Linux kernel. Since Linux is an open-source operating system and users can easily modify it and share it among others without any restrictions, it gained huge popularity ever since its initial release. <\/p>\n\n\n\n<p>Like any other Operating system, you will be required to have an interface through which you can access and perform different operations on an operating system. This interface in Linux is known as a <strong>shell.<\/strong> To make it more user-friendly and easier to access, the majority of Linux operating systems come with a Graphic user interface as their shell. <\/p>\n\n\n\n<p>On the other hand, users can also access and perform different operations on Linux OS using a command-line interface (<strong>CLI)<\/strong>. It is a very efficient, powerful, and quite a fast user interface in which a user can perform operations in a fraction of seconds by simply using basic Linux <a href=\"https:\/\/www.wpoven.com\/blog\/the-complete-guide-to-master-wp-cli-wp-cli-install-commands\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>commands in CLI.<\/strong><\/a><\/p>\n\n\n\n<p>So, it is highly recommended for Linux users to learn about some of the basic command lines so that they can increase their productivity and reduce time. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What are Linux commands?<\/h2>\n\n\n\n<p>Linux commands are a set of instructions or programs that run on a command-line interface (CLI). A command line is an interface that acts as a medium between the user and the computer. Where a user has to give lines of text or commands on CLI. Then the CLI processes these commands and gives instructions to the computer.<\/p>\n\n\n\n<p>This interface is commonly known as<strong> terminal <\/strong>in Mac Os and Windows <strong>cmd prompt<\/strong>. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Some Basic Linux Commands list<\/h2>\n\n\n\n<p>Before we introduce you to some basic Linux commands, you need to first locate and open your command-line interface first. But the steps for locating a command-line interface on Linux operating systems can be different in each distribution.<\/p>\n\n\n\n<p>However, in most cases, you will easily find the command line in the utility section of your Linux OS.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"489\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_4-1-1024x489.png\" alt=\"Command-line interface: Terminal\" class=\"wp-image-12771\" srcset=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_4-1-1024x489.png 1024w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_4-1-300x143.png 300w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_4-1-768x367.png 768w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_4-1.png 1128w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" title=\"\"><\/figure>\n\n\n\n<p>Now, here we go the list of some basic Linux commands.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1. Linux command: pwd (print working directory)<\/strong><\/h3>\n\n\n\n<p>When you open the terminal, by default you are in the home directory of the user and the <strong>pwd<\/strong> Linux command helps you to know which directory you are currently in. It displays the absolute path of your current directory. This means, the complete path from the root that starts with a forward slash <strong>(\/)<\/strong>. For example, if a user named &#8220;<strong>onworks<\/strong>&#8221; with the root directory will look like this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"733\" height=\"402\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_7-5.png\" alt=\"Linux command: pwd\" class=\"wp-image-12800\" srcset=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_7-5.png 733w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_7-5-300x165.png 300w\" sizes=\"(max-width: 733px) 100vw, 733px\" title=\"\"><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2. Linux Command: ls (list)<\/strong><\/h3>\n\n\n\n<p>Now if you like to see the listings of contents in the directory, use the &#8220;ls&#8221; command in the command line. There are multiple variations you can use with the <strong>ls<\/strong> command that help you to view more folders\/files. such as:<\/p>\n\n\n\n<p><strong>ls -a<\/strong> will show all the hidden files.<\/p>\n\n\n\n<p><strong>ls &#8211; l<\/strong> will show some extra information such as date, type of file, etc.<\/p>\n\n\n\n<p><strong>ls -R<\/strong> will show all the files in the subdirectories too.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"340\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_8-5-1024x340.png\" alt=\"Linux Command: ls\" class=\"wp-image-12801\" srcset=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_8-5-1024x340.png 1024w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_8-5-300x100.png 300w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_8-5-768x255.png 768w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_8-5.png 1035w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" title=\"\"><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3. Linux command: mkdir (make directory)<\/strong><\/h3>\n\n\n\n<p>The mkdir Linux command is used to create a new directory in the shell. All you need to do is have a unique folder name and make ensure that it does not already exist in your shell and you are ready to go.<\/p>\n\n\n\n<p>For example, if you want to create a directory named dir1, you need to type,<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir dir1<\/code><\/pre>\n\n\n\n<p>as shown in the picture below:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"359\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_9-4-1024x359.png\" alt=\"Linux command: mkdir\" class=\"wp-image-12802\" srcset=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_9-4-1024x359.png 1024w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_9-4-300x105.png 300w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_9-4-768x270.png 768w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_9-4.png 1174w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" title=\"\"><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>4. Linux command: cd (Change directory)<\/strong><\/h3>\n\n\n\n<p>This command is one of the very popular Linux commands after ls and it helps you to easily navigate or switch to different directories or folders. All you need to have is the location of the destination path or folder name, depending upon your current location and you are ready to go. <\/p>\n\n\n\n<p>For example: if you want to go to dir1, just type,<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd dir1<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"321\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_10-4-1024x321.png\" alt=\"Linux command: cd\" class=\"wp-image-12803\" srcset=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_10-4-1024x321.png 1024w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_10-4-300x94.png 300w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_10-4-768x241.png 768w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_10-4.png 1160w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" title=\"\"><\/figure>\n\n\n\n<p>The prompt will show you the current location which is <strong>dir1<\/strong> and when you type<strong> pwd<\/strong> along with <strong>dir1<\/strong>, it will show your path location i.e<strong> \/home\/onworks\/dir1.<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"910\" height=\"352\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_11-4.png\" alt=\"Linux command: cd\" class=\"wp-image-12804\" srcset=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_11-4.png 910w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_11-4-300x116.png 300w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_11-4-768x297.png 768w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" title=\"\"><\/figure>\n\n\n\n<p>If you want to go back 1 level up, into the home, there are some shortcuts you can also use such as:<\/p>\n\n\n\n<p><strong>cd..<\/strong>  The two dots will navigate you back to one level up.<\/p>\n\n\n\n<p><strong>cd~<\/strong> this will get you back directly to our home. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>5. Linux command: touch <\/strong><\/h3>\n\n\n\n<p>The <strong>touch<\/strong> Linux command will let you create a new blank file through the command line. All you need to do is type, <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>touch filename<\/code><\/pre>\n\n\n\n<p>For example, you have to create a text file name <strong>file1.txt<\/strong> using the command line, the command would be <strong>touch file1.txt<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"322\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_12-3-1024x322.png\" alt=\"Linux command: touch\" class=\"wp-image-12805\" srcset=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_12-3-1024x322.png 1024w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_12-3-300x94.png 300w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_12-3-768x242.png 768w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_12-3.png 1125w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" title=\"\"><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>6. Linux command: cat (Concatenate)<\/strong><\/h3>\n\n\n\n<p>This is also one of the most popular Linux commands, with the help of which you will be able to view, create and concatenate files directly on the terminal without opening a graphical text interface. <\/p>\n\n\n\n<p>For example, if you have created a text file named file1.txt and you want to know the content in it, all you need to do is to type,<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cat file1.txt<\/code><\/pre>\n\n\n\n<p>and the output will display the content present in it. such as if<strong> file1<\/strong> has textual content <strong>&#8220;Hello world&#8221; <\/strong>written in it. It will be displayed on the terminal as shown below:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"409\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_13-2-1024x409.png\" alt=\"Linux command: cat\" class=\"wp-image-12806\" srcset=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_13-2-1024x409.png 1024w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_13-2-300x120.png 300w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_13-2-768x307.png 768w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_13-2.png 1176w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" title=\"\"><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>7. Linux command: Less<\/strong><\/h3>\n\n\n\n<p>With the help of less Linux command, you can easily page down the text file and see the whole content on one page at a time.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>less file1.txt<\/code><\/pre>\n\n\n\n<p>This is the result that will be shown on the terminal.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"633\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_14-1-1024x633.png\" alt=\"Linux command: Less\" class=\"wp-image-12807\" srcset=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_14-1-1024x633.png 1024w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_14-1-300x185.png 300w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_14-1-768x475.png 768w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_14-1.png 1060w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" title=\"\"><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>8. Linx command: mv (move or rename file)<\/strong><\/h3>\n\n\n\n<p>If you want to move or rename files and directories, you need to use the <strong>mv <\/strong>command in Linux. To use this command, you need to type your existing\/old file name and then the new name or the destination.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mv oldfilename newfilename<\/code><\/pre>\n\n\n\n<p>or<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mv source_file destination_folder<\/code><\/pre>\n\n\n\n<p>For example, if you are renaming file1.txt to file2.txt, you have to type the Linux commands as shown in the picture below:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"843\" height=\"397\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_16.png\" alt=\"Linx command: mv\" class=\"wp-image-12808\" srcset=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_16.png 843w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_16-300x141.png 300w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_16-768x362.png 768w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" title=\"\"><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>9. Linux command: cp (Copy)<\/strong><\/h3>\n\n\n\n<p>Now you can also copy files from one directory to another using the <strong>cp<\/strong> command. Let&#8217;s say you want to take file2 to create file1 but also keep file 2. All you need to type, <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cp file2.txt file1.txt<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"427\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_17-1024x427.png\" alt=\"Linux command: cp\" class=\"wp-image-12809\" srcset=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_17-1024x427.png 1024w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_17-300x125.png 300w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_17-768x321.png 768w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_17.png 1126w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" title=\"\"><\/figure>\n\n\n\n<p>Now the contents in file 2 will be copied into file 1 without affecting the contents in file 2.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>10. Linux command: rm (remove or delete)<\/strong><\/h3>\n\n\n\n<p>Now, after knowing how to create and copy files in Linux using the command line, it will be very helpful for you to know how to remove or delete files or directories.  You can use the rm command to permanently remove or delete files. <\/p>\n\n\n\n<p>Hence, you need to be careful while using this command because, if a file has been deleted or removed it cannot be recovered back. It is better to recheck the file or directory and make sure before proceeding further.<\/p>\n\n\n\n<p>For example, to delete a file1.txt, you need to follow this command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>rm file1.txt<\/code><\/pre>\n\n\n\n<p>To remove a directory named dir2, you need to follow this command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>rmdir dir2<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"364\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_18.png\" alt=\"Linux command: rm\" class=\"wp-image-12810\" srcset=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_18.png 1024w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_18-300x107.png 300w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_18-768x273.png 768w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" title=\"\"><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>11. Linux command: which <\/strong><\/h3>\n\n\n\n<p>The &#8220;<strong>which<\/strong>&#8221; command will search for a file or folder location and give you the output of that location. For example, suppose you are looking for a mongo application location, which is the MongoDB server.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>which mongod\n# \/usr\/bin\/mongod<\/code><\/pre>\n\n\n\n<p>However, if it isn&#8217;t able to recognize the query it will give an output as an error.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"656\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_9-3-1024x656.png\" alt=\"Linux command: which\" class=\"wp-image-12790\" srcset=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_9-3-1024x656.png 1024w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_9-3-300x192.png 300w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_9-3-768x492.png 768w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_9-3.png 1041w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" title=\"\"><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>12. Linux command: history<\/strong><\/h3>\n\n\n\n<p>The <strong>history<\/strong> command turned out to be very helpful if you have been using Linux for a certain period. Especially when you have already run so many commands and at some point, in time you want to review all your previous commands. On the other hand, if you are unable to recall commands that you have used earlier, you can easily go back to the history and check out the complete list.<\/p>\n\n\n\n<p>When you type &#8221; history&#8221;, the result will show your all-past commands.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>history<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"986\" height=\"577\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_19.png\" alt=\"Linux command: history\" class=\"wp-image-12811\" srcset=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_19.png 986w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_19-300x176.png 300w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_19-768x449.png 768w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" title=\"\"><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>13. Linux command: Sudo (Superuser do)<\/strong><\/h3>\n\n\n\n<p>The Sudo command enables a user to perform certain tasks that are either restricted or require admin permissions. This is how Linux protects itself by restricting users to install any third-party packages or make changes to the system files. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get update<\/code><\/pre>\n\n\n\n<p>This command is generally used to edit or modify certain files and to install software that is outside of the user&#8217;s home directory. However, you should not use this command for general purposes, or else it can generate errors if you make even a slight mistake.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"616\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_20-1024x616.png\" alt=\"Linux command: Sudo\" class=\"wp-image-12812\" srcset=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_20-1024x616.png 1024w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_20-300x181.png 300w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_20-768x462.png 768w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_20.png 1201w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" title=\"\"><\/figure>\n\n\n\n<p>When you type<strong> sudo<\/strong>, the terminal will ask password to run the command.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>14. Linux command: top<\/strong><\/h3>\n\n\n\n<p>If you use the top command, they will show you the processes, and how much memory and CPU are consumed in the system. It is somewhat like the task manager that you find on Windows devices. This comes in handy to eliminate those processes which consume too many resources.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>top<\/code><\/pre>\n\n\n\n<p>This is how it shows complete processes running on the system:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1012\" height=\"659\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_21.png\" alt=\"Linux command: top\" class=\"wp-image-12813\" srcset=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_21.png 1012w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_21-300x195.png 300w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_21-768x500.png 768w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" title=\"\"><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>15. Linux command: df<\/strong><\/h3>\n\n\n\n<p>The <strong>df<\/strong> is another command that will show you how much disk space is left. The output will be shown in percentages as well as in Kb.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>df<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"562\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_22-1024x562.png\" alt=\"Linux command: df\" class=\"wp-image-12814\" srcset=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_22-1024x562.png 1024w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_22-300x165.png 300w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_22-768x421.png 768w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_22.png 1034w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" title=\"\"><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>16. Linux command: lsusb<\/strong><\/h3>\n\n\n\n<p>The<strong> lsusb<\/strong> command will show the devices like USB hubs, USB buses in the system, and all the devices connected via USB to them.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>lsusb<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"526\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_23-1024x526.png\" alt=\"Linux command: lsusb\" class=\"wp-image-12815\" srcset=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_23-1024x526.png 1024w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_23-300x154.png 300w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_23-768x395.png 768w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_23.png 1201w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" title=\"\"><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>17. Linux command: shutdown<\/strong><\/h3>\n\n\n\n<p>The <strong>shutdown<\/strong> command will let you either completely turn off the computer or you can also reboot your system. If you want to power off your system type,<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>shutdown now<\/code><\/pre>\n\n\n\n<p>However, you can also set a time and schedule your system power off in 24hr format.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>shutdown 16:00<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong> 18. Linux command: uname (UNIX name)<\/strong><\/h3>\n\n\n\n<p>The <strong>name<\/strong> command will show all the information about your Linux system such as operating system, kernel, etc. Although the simple <strong>uname <\/strong>command is not that useful and doesn&#8217;t provide detailed information, it is advisable to use it with the (-a) flag, which helps in to show all the information.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>uname -a<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"443\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_25-1024x443.png\" alt=\"Linux command: uname \" class=\"wp-image-12816\" srcset=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_25-1024x443.png 1024w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_25-300x130.png 300w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_25-768x332.png 768w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_25.png 1172w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" title=\"\"><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>19. Linux command: exit <\/strong><\/h3>\n\n\n\n<p>From the name itself, you can get an idea of what this command is capable of. You can use this command either to close a current session or close the terminal.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>exit<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>20. Linux command: head<\/strong><\/h3>\n\n\n\n<p>The head command gives you an output of the first 10 lines (by default) of any text file. However, you can also decide how many lines you want to view using the -n argument. For example, if you want to view the first 3 lines of a text file and you need to type:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>head -n 3 file1.txt<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"932\" height=\"589\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_26.png\" alt=\"Linux command: head\" class=\"wp-image-12817\" srcset=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_26.png 932w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_26-300x190.png 300w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_26-768x485.png 768w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" title=\"\"><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>21. Linux command: tail<\/strong><\/h3>\n\n\n\n<p>The tail command has similar functions to the head command. But the main difference is, that instead of displaying the first lines of a text file, the tail command will display the last ten lines of a text file.<\/p>\n\n\n\n<p>For example, if you want to view the last 3 lines of a text file, you need to type:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tail -n 3 file1.txt<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>22. Linux command: ping<\/strong><\/h3>\n\n\n\n<p>The ping command lets you know the network connectivity status with a domain or IP address. Suppose, if you use the ping command along with anydomain.com, the command will check the connectivity status of anydomain.com and its response time.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ping anydomain.com<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"945\" height=\"568\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_27.png\" alt=\"Linux command: ping\" class=\"wp-image-12818\" srcset=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_27.png 945w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_27-300x180.png 300w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_27-768x462.png 768w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" title=\"\"><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>23. Linux command: unzip and zip<\/strong><\/h3>\n\n\n\n<p>The unzip command lets you extract all the contents from the zip archive. For example, if you want to unzip a zip file say <strong>xyz.zip<\/strong>. You need to type:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>unzip xyz.zip<\/code><\/pre>\n\n\n\n<p>Similarly, you can also compress any file into a zip archive using the <strong>zip<\/strong> command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>zip image.jpg<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>24. Linux command: kill<\/strong><\/h3>\n\n\n\n<p>The <strong>kill<\/strong> command comes in handy when you found any of the programs that are running and it becomes unresponsive and you are unable to stop or close the program. You can directly terminate it by using the kill program. <\/p>\n\n\n\n<p>When you use the kill command, it sends a signal to the unresponsive app and instructs it to terminate itself. To kill any program, you can use either its process ID or the name of a program.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kill chrome<\/code><\/pre>\n\n\n\n<p><strong>Note: <\/strong>Be careful while using the kill command, because if anything went wrong you might lose the work you are currently doing.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>25. Linux command: wget (world wide web get)<\/strong><\/h3>\n\n\n\n<p>To download any file from the internet, you can use <strong>wget<\/strong> command. Since you can download files from the internet, it has the largest collection of flags available.<\/p>\n\n\n\n<p>For example, if you like to download a file from the download link: https:\/\/downloadlink.com\/, you need to use the command as follows:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wget https:\/\/downloadlink.com\/<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>26. Linux command: echo<\/strong><\/h3>\n\n\n\n<p>The echo command is generally used to add or move some data into a file. for example, if you want to add some text &#8220;welcome to my world&#8221; into the file1.txt file. You need to type,<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>echo welcome to my world &gt;&gt;file1.txt<\/code><\/pre>\n\n\n\n<p>This command can also be used to display simple texts on the terminal, for that you need to type.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>echo \"welcome to my world\"<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"519\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_28-1024x519.png\" alt=\"Linux command: echo\" class=\"wp-image-12819\" srcset=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_28-1024x519.png 1024w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_28-300x152.png 300w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_28-768x389.png 768w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_28.png 1184w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" title=\"\"><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>27. Linux command: passwd <\/strong><\/h3>\n\n\n\n<p>With the help of <strong>passwd<\/strong> command, you can change the password of users&#8217; accounts. When you type the <strong>passwd<\/strong> command, a prompt message will appear asking you to type the current password. After that, you will be required to type the password and confirmation.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>passwrd<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>28. Linux command: chmod<\/strong><\/h3>\n\n\n\n<p>With <strong>chmod<\/strong> command, you can change the permission of a file or directory instantly. You can make a file or directory either <strong>readable(r)<\/strong>, <strong>writable(w)<\/strong> or <strong>executable(x)<\/strong>. <\/p>\n\n\n\n<p>For example, if you want to give execute permission to a file, the command will be as follows:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>chmod +x script<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>29. Linux command: wc (Word count)<\/strong><\/h3>\n\n\n\n<p>The <strong>wc<\/strong> command is used to determine the number of words in a text file. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"818\" height=\"447\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_29.png\" alt=\"Linux command: wc\" class=\"wp-image-12820\" srcset=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_29.png 818w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_29-300x164.png 300w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_29-768x420.png 768w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" title=\"\"><\/figure>\n\n\n\n<p>Input command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wc file1.txt<\/code><\/pre>\n\n\n\n<p>The output will be displayed as:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>2 6 32 file1.txt<\/code><\/pre>\n\n\n\n<ul>\n<li>where <strong>2<\/strong> represents the number of lines,<\/li>\n\n\n\n<li><strong>6 <\/strong>shows the total word count,<\/li>\n\n\n\n<li><strong>32<\/strong> byte shows the size and <\/li>\n\n\n\n<li><strong>file1.txt<\/strong> shows the text file.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>30. Linux command: locate<\/strong><\/h3>\n\n\n\n<p>The <strong>locate <\/strong>command in Linux helps you to locate a file in the Linux system. It is somewhat similar to the search feature in the window system. This command comes in handy when you do not know the exact location of saved files or file names.<\/p>\n\n\n\n<p>Using it with the <strong>-i <\/strong>flag, helps in to ignore the case and show results in both upper and lower cases.  For example, suppose you want to search a textual file that has a &#8220;<strong>hello<\/strong> <strong>world<\/strong>&#8221; written in it. You need to type,<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>locate -i *hello*world<\/code><\/pre>\n\n\n\n<p>It will give you a list of all the files in the Linux system that have the words &#8220;hello world&#8221;.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"751\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_30-1024x751.png\" alt=\"Linux command: locate\" class=\"wp-image-12821\" srcset=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_30-1024x751.png 1024w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_30-300x220.png 300w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_30-768x564.png 768w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_30.png 1063w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" title=\"\"><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>31. Linux command: nano <\/strong><\/h3>\n\n\n\n<p>If you want to edit text files, the Linux system has nano and vi text editors by default. With the help of this command, you can create a new file and modify it directly using the editor. It is basically pretty easy to use and supports many languages. <\/p>\n\n\n\n<p>Now, let us understand it with an example, if you are going to create a new text file (file1.txt), you need to type <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nano file1.txt<\/code><\/pre>\n\n\n\n<p>After that, an editor will be open where you can edit and save your file by using the combination Cntrl+X. After that select &#8220;<strong>Y&#8221;<\/strong> for <strong>Yes<\/strong> or<strong> &#8220;N&#8221;<\/strong> for <strong>No<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"567\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_31-1024x567.png\" alt=\"Linux command: nano\" class=\"wp-image-12822\" srcset=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_31-1024x567.png 1024w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_31-300x166.png 300w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_31-768x425.png 768w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_31.png 1065w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" title=\"\"><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>32. Linux command: whatis<\/strong><\/h3>\n\n\n\n<p>The &#8220;<strong>whatis<\/strong>&#8221; command is used to view a single-line description of any other command. This command can be helpful if you are looking for meaning for any new command. <\/p>\n\n\n\n<p>For example, if you are looking for the meaning of <strong>whatis command itself<\/strong> by typing <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>whatis whatis<\/code><\/pre>\n\n\n\n<p>you will have the following output as shown in the picture below:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"952\" height=\"430\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_6-3.png\" alt=\"Linux command: whatis\" class=\"wp-image-12799\" srcset=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_6-3.png 952w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_6-3-300x136.png 300w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_6-3-768x347.png 768w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" title=\"\"><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>33. Linux command: whoami (Who am i )<\/strong><\/h3>\n\n\n\n<p>From the command name itself, it is clear that it is used to find out the current username. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>whoami<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"437\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_32-1024x437.png\" alt=\"Linux command: whoami\" class=\"wp-image-12823\" srcset=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_32-1024x437.png 1024w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_32-300x128.png 300w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_32-768x328.png 768w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_32.png 1172w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" title=\"\"><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>34. Linux command: diff (difference)<\/strong><\/h3>\n\n\n\n<p>The <strong>diff<\/strong> or difference command is used to compare or find out the difference between the contents of the two files. The output of this command will display the lines that are not matched. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>diff<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1001\" height=\"688\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_33.png\" alt=\"Linux command: diff\" class=\"wp-image-12824\" srcset=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_33.png 1001w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_33-300x206.png 300w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_33-768x528.png 768w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" title=\"\"><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>35. Linux command: grep<\/strong><\/h3>\n\n\n\n<p>The <strong>grep<\/strong> command is another most basic Linux command with the help of which you can search thoroughly in the given file. For example, suppose you have to search world in the file1.txt, for that you have to type,<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>grep world file1.txt<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"975\" height=\"647\" src=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_34.png\" alt=\"Linux command: grep\" class=\"wp-image-12825\" srcset=\"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_34.png 975w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_34-300x199.png 300w, https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot_34-768x510.png 768w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" title=\"\"><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Summary<\/strong><\/h2>\n\n\n\n<p>Although there are plenty of Linux commands available, these are some of the most basic commands that every beginner must be aware of. It will take time for any beginner to learn and remember these Linux commands but once they are able to master them, nothing can stop them from easily managing their <a href=\"https:\/\/www.wpoven.com\/vps-hosting\/\" target=\"_blank\" rel=\"noreferrer noopener\">VPS<\/a> as well as Linux systems. <\/p>\n\n\n\n<p>If you have any doubt or would like to add more basic Linux commands to our Linux command list, please do let us know in the comment section below.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Frequently Asked Questions<\/strong><\/h2>\n\n\n<div id=\"rank-math-faq\" class=\"rank-math-block\">\n<div class=\"rank-math-list \">\n<div id=\"faq-question-1649925321981\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \">What are the commands in Linux?<\/h3>\n<div class=\"rank-math-answer \">\n\n<p>some of the Basic Linux commands are:<br \/>1. <strong>nano<\/strong> &#8211; It helps to create a blank text file.<br \/>2.<strong> pwd<\/strong> &#8211; display your current directory<br \/>3. <strong>ls<\/strong> &#8211; shows the list of the contents in a directory<br \/>4. <strong>mkdir<\/strong> &#8211; creates a new directory<br \/>5. <strong>cd<\/strong> &#8211; change directory<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1649925516025\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \">How do I learn Linux commands?<\/h3>\n<div class=\"rank-math-answer \">\n\n<p>To learn Linux commands, the best thing you can do is to practice with basic commands on the terminal. For example, to check the current directory use &#8220;<strong>pwd<\/strong>&#8221; command on the terminal or to create a text file using the &#8220;<strong>touch&#8221;<\/strong> command on the terminal.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1649925756578\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \">How many commands are in Linux?<\/h3>\n<div class=\"rank-math-answer \">\n\n<p>There are more than 100 UNIX commands available.<\/p>\n\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>It would be an interesting thing for you to know that Linux has merely a 2% share in the global market of operating systems. But you will be surprised to know that more than 90% of the global cloud computing and web hosting services use Linux operating system. And it is highly popular among developers and professionals. <\/p>\n<p>Hence, it becomes essential for any beginner or individual who is into IT must be familiar with some basic Linux commands. &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.wpoven.com\/blog\/linux-commands\/\" class=\"more-link\">Read More <i class=\"fa fa-angle-double-right\" aria-hidden=\"true\"><\/i><span class=\"screen-reader-text\"> &#8220;35 Best Linux Commands For Beginners&#8221;<\/span><\/a><\/p>\n","protected":false},"author":28,"featured_media":12841,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ub_ctt_via":"","footnotes":""},"categories":[6],"acf":[],"featured_image_src":"https:\/\/www.wpoven.com\/blog\/wp-content\/uploads\/2022\/04\/35_Useful_and_Basic_Linux_Commands_You_Should_Know.png","author_info":{"display_name":"Rahul","author_link":"https:\/\/www.wpoven.com\/blog\/author\/rahul\/"},"_links":{"self":[{"href":"https:\/\/www.wpoven.com\/blog\/wp-json\/wp\/v2\/posts\/12765"}],"collection":[{"href":"https:\/\/www.wpoven.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wpoven.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wpoven.com\/blog\/wp-json\/wp\/v2\/users\/28"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wpoven.com\/blog\/wp-json\/wp\/v2\/comments?post=12765"}],"version-history":[{"count":2,"href":"https:\/\/www.wpoven.com\/blog\/wp-json\/wp\/v2\/posts\/12765\/revisions"}],"predecessor-version":[{"id":26663,"href":"https:\/\/www.wpoven.com\/blog\/wp-json\/wp\/v2\/posts\/12765\/revisions\/26663"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wpoven.com\/blog\/wp-json\/wp\/v2\/media\/12841"}],"wp:attachment":[{"href":"https:\/\/www.wpoven.com\/blog\/wp-json\/wp\/v2\/media?parent=12765"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wpoven.com\/blog\/wp-json\/wp\/v2\/categories?post=12765"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}