{"id":1604,"date":"2021-09-22T13:45:22","date_gmt":"2021-09-22T08:15:22","guid":{"rendered":"https:\/\/www.webhostingchennai.co.in\/blog\/?p=1604"},"modified":"2021-10-06T13:01:55","modified_gmt":"2021-10-06T07:31:55","slug":"top-50-linux-commands","status":"publish","type":"post","link":"https:\/\/chennaiwebhosting.in\/blog\/top-50-linux-commands\/","title":{"rendered":"Top 50 Linux Commands"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_80 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/chennaiwebhosting.in\/blog\/top-50-linux-commands\/#Top_50_Linux_Commands_you_must_know_as_a_regular_user\" >Top 50 Linux Commands you must know as a regular user<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/chennaiwebhosting.in\/blog\/top-50-linux-commands\/#The_ls_command_in_Linux\" >The ls command in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/chennaiwebhosting.in\/blog\/top-50-linux-commands\/#The_pwd_command_in_Linux\" >The pwd command in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/chennaiwebhosting.in\/blog\/top-50-linux-commands\/#The_cd_command_in_Linux\" >The cd command in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/chennaiwebhosting.in\/blog\/top-50-linux-commands\/#The_mkdir_command_in_Linux\" >The mkdir command in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/chennaiwebhosting.in\/blog\/top-50-linux-commands\/#The_cp_and_mv_commands\" >The cp and mv commands<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/chennaiwebhosting.in\/blog\/top-50-linux-commands\/#The_rm_command_in_Linux\" >The rm command in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/chennaiwebhosting.in\/blog\/top-50-linux-commands\/#The_touch_command_in_Linux\" >The touch command in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/chennaiwebhosting.in\/blog\/top-50-linux-commands\/#The_ln_command_in_Linux\" >The ln command in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/chennaiwebhosting.in\/blog\/top-50-linux-commands\/#The_cat_echo_and_less_commands\" >The cat, echo, and less commands<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/chennaiwebhosting.in\/blog\/top-50-linux-commands\/#The_man_command_in_Linux\" >The man command in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/chennaiwebhosting.in\/blog\/top-50-linux-commands\/#The_uname_and_whoami_commands\" >The uname and whoami commands<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/chennaiwebhosting.in\/blog\/top-50-linux-commands\/#The_tar_zip_and_unzip_commands\" >The tar, zip, and unzip commands<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/chennaiwebhosting.in\/blog\/top-50-linux-commands\/#The_grep_command_in_Linux\" >The grep command in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/chennaiwebhosting.in\/blog\/top-50-linux-commands\/#The_head_and_tail_commands\" >The head and tail commands<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/chennaiwebhosting.in\/blog\/top-50-linux-commands\/#The_diff_comm_and_cmp_commands\" >The diff, comm, and cmp commands<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/chennaiwebhosting.in\/blog\/top-50-linux-commands\/#The_sort_command_in_Linux\" >The sort command in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/chennaiwebhosting.in\/blog\/top-50-linux-commands\/#The_export_command_in_Linux\" >The export command in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/chennaiwebhosting.in\/blog\/top-50-linux-commands\/#The_ssh_command_in_Linux\" >The ssh command in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/chennaiwebhosting.in\/blog\/top-50-linux-commands\/#The_service_command_in_Linux\" >The service command in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/chennaiwebhosting.in\/blog\/top-50-linux-commands\/#The_ps_kill_and_killall_commands\" >The ps, kill, and killall commands<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-22\" href=\"https:\/\/chennaiwebhosting.in\/blog\/top-50-linux-commands\/#The_df_and_mount_commands\" >The df and mount commands<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-23\" href=\"https:\/\/chennaiwebhosting.in\/blog\/top-50-linux-commands\/#The_chmod_and_chown_commands\" >The chmod and chown commands<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-24\" href=\"https:\/\/chennaiwebhosting.in\/blog\/top-50-linux-commands\/#The_ifconfig_and_traceroute_commands\" >The ifconfig and traceroute commands<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-25\" href=\"https:\/\/chennaiwebhosting.in\/blog\/top-50-linux-commands\/#The_wget_command_in_Linux\" >The wget command in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-26\" href=\"https:\/\/chennaiwebhosting.in\/blog\/top-50-linux-commands\/#The_ufw_and_iptables_commands\" >The ufw and iptables commands<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-27\" href=\"https:\/\/chennaiwebhosting.in\/blog\/top-50-linux-commands\/#Package_Managers_in_Linux\" >Package Managers in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-28\" href=\"https:\/\/chennaiwebhosting.in\/blog\/top-50-linux-commands\/#The_sudo_command_in_Linux\" >The sudo command in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-29\" href=\"https:\/\/chennaiwebhosting.in\/blog\/top-50-linux-commands\/#The_cal_command_in_Linux\" >The cal command in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-30\" href=\"https:\/\/chennaiwebhosting.in\/blog\/top-50-linux-commands\/#The_alias_command\" >The alias command<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-31\" href=\"https:\/\/chennaiwebhosting.in\/blog\/top-50-linux-commands\/#The_dd_command_in_Linux\" >The dd command in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-32\" href=\"https:\/\/chennaiwebhosting.in\/blog\/top-50-linux-commands\/#The_whereis_and_whatis_commands\" >The whereis and whatis commands<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-33\" href=\"https:\/\/chennaiwebhosting.in\/blog\/top-50-linux-commands\/#The_top_command_in_Linux\" >The top command in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-34\" href=\"https:\/\/chennaiwebhosting.in\/blog\/top-50-linux-commands\/#The_useradd_and_usermod_commands\" >The useradd and usermod commands<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-35\" href=\"https:\/\/chennaiwebhosting.in\/blog\/top-50-linux-commands\/#The_passwd_command_in_Linux\" >The passwd command in Linux<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Top_50_Linux_Commands_you_must_know_as_a_regular_user\"><\/span>Top 50 Linux Commands you must know as a regular user<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Here, let us see the top 50 linux commands, used on regular basis<\/p>\n<ol>\n<li><strong>ls<\/strong> \u2013 The most frequently used command in Linux to list directories<\/li>\n<li><strong>pwd<\/strong> \u2013 Print working directory command in Linux<\/li>\n<li><strong>cd<\/strong> \u2013 Linux command to navigate through directories<\/li>\n<li><strong>mkdir<\/strong> \u2013 Command used to create directories in Linux<\/li>\n<li><strong>mv<\/strong> \u2013 Move or rename files in Linux<\/li>\n<li><strong>cp<\/strong> \u2013 Similar usage as mv but for copying files in Linux<\/li>\n<li><strong>rm<\/strong> \u2013 Delete files or directories<\/li>\n<li><strong>touch<\/strong> \u2013 Create blank\/empty files<\/li>\n<li><strong>ln<\/strong> \u2013 Create symbolic links (shortcuts) to other files<\/li>\n<li><strong>cat<\/strong> \u2013 Display file contents on the terminal<\/li>\n<li><strong>clear<\/strong> \u2013 Clear the terminal display<\/li>\n<li><strong>echo<\/strong> \u2013 Print any text that follows the command<\/li>\n<li><strong>less<\/strong> \u2013 Linux command to display paged outputs in the terminal<\/li>\n<li><strong>man<\/strong> \u2013 Access manual pages for all Linux commands<\/li>\n<li><strong>uname<\/strong> \u2013 Linux command to get basic information about the OS<\/li>\n<li><strong>whoami<\/strong> \u2013 Get the active username<\/li>\n<li><strong>tar<\/strong> \u2013 Command to extract and compress files in Linux<\/li>\n<li><strong>grep<\/strong> \u2013 Search for a string within an output<\/li>\n<li><strong>head<\/strong> \u2013 Return the specified number of lines from the top<\/li>\n<li><strong>tail<\/strong> \u2013 Return the specified number of lines from the bottom<\/li>\n<li><strong>diff<\/strong> \u2013 Find the difference between two files<\/li>\n<li><strong>cmp<\/strong> \u2013 Allows you to check if two files are identical<\/li>\n<li><strong>comm<\/strong> \u2013 Combines the functionality of diff and cmp<\/li>\n<li><strong>sort<\/strong> \u2013 Linux command to sort the content of a file while outputting<\/li>\n<li><strong>export<\/strong> \u2013 Export environment variables in Linux<\/li>\n<li><strong>zip <\/strong>\u2013 Zip files in Linux<\/li>\n<li><strong>unzip<\/strong> \u2013 Unzip files in Linux<\/li>\n<li><strong>ssh<\/strong> \u2013 Secure Shell command in Linux<\/li>\n<li><strong>service<\/strong> \u2013 Linux command to start and stop services<\/li>\n<li><strong>ps<\/strong> \u2013 Display active processes<\/li>\n<li><strong>kill and killall<\/strong> \u2013 Kill active processes by process ID or name<\/li>\n<li><strong>df<\/strong> \u2013 Display disk filesystem information<\/li>\n<li><strong>mount<\/strong> \u2013 Mount file systems in Linux<\/li>\n<li><strong>chmod<\/strong> \u2013 Command to change file permissions<\/li>\n<li><strong>chown<\/strong> \u2013 Command for granting ownership of files or folders<\/li>\n<li><strong>ifconfig<\/strong> \u2013 Display network interfaces and IP addresses<\/li>\n<li><strong>traceroute<\/strong> \u2013 Trace all the network hops to reach the destination<\/li>\n<li><strong>wget<\/strong> \u2013 Direct download files from the internet<\/li>\n<li><strong>ufw<\/strong> \u2013 Firewall command<\/li>\n<li><strong>iptables<\/strong> \u2013 Base firewall for all other firewall utilities to interface with<\/li>\n<li><strong>apt, pacman, yum, rpm<\/strong> \u2013 Package managers depending on the distro<\/li>\n<li><strong>sudo<\/strong> \u2013 Command to escalate privileges in Linux<\/li>\n<li><strong>cal<\/strong> \u2013 View a command-line calendar<\/li>\n<li><strong>alias \u2013<\/strong> Create custom shortcuts for your regularly used commands<\/li>\n<li><strong>dd<\/strong> \u2013 Majorly used for creating bootable USB sticks<\/li>\n<li><strong>whereis<\/strong> \u2013 Locate the binary, source, and manual pages for a command<\/li>\n<li><strong>whatis<\/strong> \u2013 Find what a command is used for<\/li>\n<li><strong>top<\/strong> \u2013 View active processes live with their system usage<\/li>\n<li><strong>useradd and usermod<\/strong> \u2013 Add new user or change existing users data<\/li>\n<li><strong>passwd<\/strong> \u2013 Create or update passwords for existing users<\/li>\n<\/ol>\n<div class=\"mceTemp\"><\/div>\n<div class=\"code-block code-block-6\">\n<div id=\"videoAdSlot\">\n<div id=\"primisPlayerContainerDiv\" class=\"primisslate\">\n<div id=\"primis_container_div\">\n<h2 id=\"placeHolder\"><span class=\"ez-toc-section\" id=\"The_ls_command_in_Linux\"><\/span>The ls command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<article id=\"post-34067\" class=\"post-34067 post type-post status-publish format-standard has-post-thumbnail hentry category-unix-linux\">\n<div class=\"entry-content blog-post__contents\">\n<p>The ls command is used to list files and directories in the current working directory. This is going to be one of the most frequently used Linux commands you must know of.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\">As you can see in the above image, using the command by itself without any arguments will give us an output with all the files and directories in the directory. The command offers a lot of flexibility in terms of displaying the data in the output.<\/figure>\n<\/div>\n<h2><span class=\"ez-toc-section\" id=\"The_pwd_command_in_Linux\"><\/span>The pwd command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The pwd command allows you to print the current working directory on your terminal. It\u2019s a very basic command and solves its purpose very well.<\/p>\n<div class=\"code-block code-block-5\">\n<div id=\"00000001-1542fec7-2928-4910-b324-69f6b5deebfa\" class=\"_ap_apex_ad\" data-section=\"00000001-1542fec7-2928-4910-b324-69f6b5deebfa\" data-orig-id=\"306c3248-f841-40c0-ae7c-bb2061187e4f\" data-render-time=\"1632280669650\" data-ap-network=\"adpTags\" data-refresh-time=\"1632282103864\" data-timeout=\"4603\">\n<div id=\"ADP_42209_300x250_00000001-1542fec7-2928-4910-b324-69f6b5deebfa\" data-google-query-id=\"CNH9ttnUkfMCFSCBrAIdOHoCdw\">\n<div id=\"google_ads_iframe_\/103512698,14629573\/22274416068_0__container__\">Now, your terminal prompt should usually have the complete directory anyway. But in case it doesn\u2019t, this can be a quick command to see the directory that you\u2019re in. Another application of this command is when creating scripts where this command can allow us to find the directory where the script has been saved.<\/div>\n<\/div>\n<\/div>\n<\/div>\n<h2><span class=\"ez-toc-section\" id=\"The_cd_command_in_Linux\"><\/span>The cd command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>While working within the terminal, moving around within directories is pretty much a necessity. The cd command is one of the important Linux commands you must know and it will help you to navigate through directories. Just type <strong>cd<\/strong> followed by directory as shown below.<\/p>\n<pre>root@webhostc:~# cd &lt;directory path&gt;<\/pre>\n<p>As you can see in the above command, I simply typed <strong>cd \/etc\/<\/strong> to get into the \/etc directory. We used the <strong>pwd command<\/strong> to print the current working directory.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"The_mkdir_command_in_Linux\"><\/span>The mkdir command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The mkdir command allows you to create directories from within the terminal. The default syntax is <strong>mkdir<\/strong> followed by the directory name.<\/p>\n<pre>root@webhostc:~# mkdir &lt;folder name&gt;<\/pre>\n<\/div>\n<\/article>\n<h2 class=\"aligncenter size-large\" style=\"text-align: left;\"><span class=\"ez-toc-section\" id=\"The_cp_and_mv_commands\"><\/span>The cp and mv commands<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<article id=\"post-34067\" class=\"post-34067 post type-post status-publish format-standard has-post-thumbnail hentry category-unix-linux\">\n<div class=\"entry-content blog-post__contents\">\n<p>The cp and mv commands are equivalent to the copy-paste and cut-paste in Windows. But since Linux doesn\u2019t really have a command for renaming files, we also make use of the mv command to rename files and folders.<\/p>\n<pre>root@webhostc:~# cp &lt;source&gt; &lt;destination&gt;<\/pre>\n<p>In the above command, we created a copy of the file named Sample. Let\u2019s see how what happens if we use the mv command in the same manner. For this demonstration, I\u2019ll delete the Sample-Copy file.<\/p>\n<pre>root@webhostc:~# mv &lt;source&gt; &lt;destination&gt;<\/pre>\n<p>In the above case, since we were moving the file within the same directory, it acted as rename. The file name is now changed.<\/p>\n<div class=\"code-block code-block-5\">\n<div id=\"00000001-4eca80fc-051b-47e9-b8bd-075c65184007\" class=\"_ap_apex_ad\" data-section=\"00000001-4eca80fc-051b-47e9-b8bd-075c65184007\" data-orig-id=\"306c3248-f841-40c0-ae7c-bb2061187e4f\" data-render-time=\"1632280669668\" data-ap-network=\"adpTags\" data-refresh-time=\"1632282106179\" data-timeout=\"4650\">\n<div id=\"ADP_42209_300x250_00000001-4eca80fc-051b-47e9-b8bd-075c65184007\" data-google-query-id=\"CJyMnbLPkfMCFSuArAIdu2sBaA\">\n<h2 id=\"google_ads_iframe_\/103512698,14629573\/22274416068_2__container__\"><span class=\"ez-toc-section\" id=\"The_rm_command_in_Linux\"><\/span>The rm command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<\/div>\n<\/div>\n<\/div>\n<p>In the previous section, we deleted the Sample-Copy file. The rm command is used to delete files and folders and is one of the important Linux commands you must know.<\/p>\n<pre>root@webhostc:~# rm -f&lt;file name&gt;\r\nroot@webhostc:~# rm -rf &lt;folder\/directory name&gt;<\/pre>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\">To delete a directory, you have to add the <strong>-r<\/strong> argument to it. Without the -r argument, rm command won\u2019t delete directories.<\/figure>\n<\/div>\n<h2><span class=\"ez-toc-section\" id=\"The_touch_command_in_Linux\"><\/span>The touch command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>To create a new file, the touch command will be used. The <strong>touch<\/strong> keyword followed by the file name will create a file in the current directory.<\/p>\n<pre>root@webhostc:~# touch &lt;file name&gt;<\/pre>\n<\/div>\n<\/article>\n<h2 class=\"aligncenter size-large\"><span class=\"ez-toc-section\" id=\"The_ln_command_in_Linux\"><\/span>The ln command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<article id=\"post-34067\" class=\"post-34067 post type-post status-publish format-standard has-post-thumbnail hentry category-unix-linux\">\n<div class=\"entry-content blog-post__contents\">\n<p>To create a link to another file, we use the ln command. This is one of the important Linux commands that you should know if you\u2019re planning to work as a Linux administrator.<\/p>\n<pre>root@webhostc:~# ln -s &lt;source path&gt; &lt;link name&gt;<\/pre>\n<p>The basic syntax involves using the <strong>-s<\/strong> parameter so we can create a symbolic link or soft link.<\/p>\n<div class=\"code-block code-block-5\">\n<div id=\"00000001-63e0c92b-5deb-41d7-ab45-c203e102af2d\" class=\"_ap_apex_ad\" data-section=\"00000001-63e0c92b-5deb-41d7-ab45-c203e102af2d\" data-orig-id=\"306c3248-f841-40c0-ae7c-bb2061187e4f\" data-render-time=\"1632280669681\" data-ap-network=\"adpTags\" data-refresh-time=\"1632282106705\" data-timeout=\"4670\">\n<div id=\"ADP_42209_300x250_00000001-63e0c92b-5deb-41d7-ab45-c203e102af2d\" data-google-query-id=\"CJ2MnbLPkfMCFSuArAIdu2sBaA\">\n<h2 id=\"google_ads_iframe_\/103512698,14629573\/22274416068_3__container__\"><span class=\"ez-toc-section\" id=\"The_cat_echo_and_less_commands\"><\/span>The cat, echo, and less commands<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<\/div>\n<\/div>\n<\/div>\n<p>When you want to output the contents of a file, or print anything to the terminal output, we make use of the cat or echo commands. Let\u2019s see their basic usage. I\u2019ve added some text to our New-File that we created earlier.<\/p>\n<pre>root@webhostc:~# cat &lt;file name&gt;\r\nroot@webhostc:~# echo &lt;Text to print on terminal&gt;<\/pre>\n<p>As you can see in the above example, the <strong>cat command<\/strong> when used on our \u201cNew-File\u201d, prints the contents of the file. At the same time, when we use <strong>echo command<\/strong>, it simply prints whatever follows after the command.<\/p>\n<p>The <strong>less command<\/strong> is used when the output printed by any command is larger than the screen space and needs scrolling. The less command allows use to break down the output and scroll through it with the use of the enter or space keys.<\/p>\n<p>The simple way to do this is with the use of the pipe operator (<strong>|<\/strong>).<\/p>\n<pre>root@webhostc:~# cat \/boot\/grub\/grub.cfg | less<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"The_man_command_in_Linux\"><\/span>The man command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The man command is a very useful Linux command you must know. When working with <a href=\"https:\/\/www.squarebrothers.com\/dedicated-server-in-india\/\" rel=\"nofollow noopener\" target=\"_blank\">Linux<\/a>, the packages that we download can have a lot of functionality. Knowing it all is impossible.<\/p>\n<p>The man pages offer a really efficient way to know the functionality of pretty much all the packages that you can download using the package managers in your Linux distro.<\/p>\n<pre>root@webhostc:~# man &lt;command&gt;<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"The_uname_and_whoami_commands\"><\/span>The uname and whoami commands<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The uname and whoami commands allow you to know some basic information which comes really handy when you work on multiple systems. In general, if you\u2019re working with a single computer, you won\u2019t really need it as often as someone who is a network administrator.<\/p>\n<p>Let\u2019s see the output of both the commands and the way we can use these.<\/p>\n<pre>root@webhostc:~# uname -a<\/pre>\n<p>The parameter <strong>-a<\/strong> which I\u2019ve supplied to uname, stands for \u201call\u201d. This prints out the complete information. If the parameter is not added, all you will get as the output is \u201cLinux\u201d.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"The_tar_zip_and_unzip_commands\"><\/span>The tar, zip, and unzip commands<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The tar command in Linux is used to create and extract archived files in Linux. We can extract multiple different archive files using the tar command.<\/p>\n<p>To create an archive, we use the -c parameter and to extract an archive, we use the -x parameter. Let\u2019s see it working.<\/p>\n<p>Compress<\/p>\n<\/div>\n<pre class=\"entry-content blog-post__contents\">root@webhostc:~# tar -cvf &lt;archive name&gt; &lt;files seperated by space&gt;<\/pre>\n<div class=\"entry-content blog-post__contents\">Extract<\/div>\n<div class=\"entry-content blog-post__contents\">\n<pre>root@webhostc:~# tar -xvf &lt;archive name&gt;<\/pre>\n<p>In the first line, we created an archive named <strong>Compress.tar<\/strong> with the New-File and New-File-Link. In the next command, we have extracted those files from the archive.<\/p>\n<p>Now coming to the zip and unzip commands. Both these commands are very straight forward. You can use them without any parameters and they\u2019ll work as intended. Let\u2019s see an example below.<\/p>\n<pre>root@webhostc:~# zip &lt;archive name&gt; &lt;file names separated by space&gt;\r\nroot@webhostc:~# unzip &lt;archive name&gt;<\/pre>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\">Since we already have those files in the same directory, the unzip command prompts us before overwriting those files.<\/figure>\n<\/div>\n<h2><span class=\"ez-toc-section\" id=\"The_grep_command_in_Linux\"><\/span>The grep command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>If you wish to search for a specific string within an output, the grep command comes into the picture. We can pipe (<strong>|<\/strong>) the output to the grep command and extract the required string.<\/p>\n<pre>root@webhostc:~# &lt;Any command with output&gt; | grep &quot;&lt;string to find&gt;&quot;<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"The_head_and_tail_commands\"><\/span>The head and tail commands<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>When outputting large files, the head and the tail commands come in handy. I\u2019ve created a file named \u201cWords\u201d with a lot of words arranged alphabetically in it. The head command will output the first 10 lines from the file, while the tail command will output the last 10. This also includes any blank lines and not just lines with text.<\/p>\n<pre>root@webhostc:~# head &lt;file name&gt;\r\nroot@webhostc:~# tail &lt;file name&gt;<\/pre>\n<p>As you can see, the head command showed 10 lines from the top of the file.<\/p>\n<p>The tail command outputted the bottom 10 lines from the file.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"The_diff_comm_and_cmp_commands\"><\/span>The diff, comm, and cmp commands<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Linux offers multiple commands to compare files. The diff, comm, and cmp commands compare differences and are some of the most useful Linux commands you must know. Let\u2019s see the default outputs for all the three commands.<\/p>\n<pre>root@webhostc:~# diff &lt;file 1&gt; &lt;file 2&gt;<\/pre>\n<p>As you can see above, I\u2019ve added a small piece of text saying \u201cThis line is edited\u201d to the New-File-Edited file.<\/p>\n<div class=\"wp-block-syntaxhighlighter-code \">\n<pre>root@webhostc:~# cmp &lt;file 1&gt; &lt;file 2&gt;<\/pre>\n<\/div>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\">The cmp command only tells use the line number which is different. Not the actual text. Let\u2019s see what the comm command does.<\/figure>\n<pre>root@webhostc:~# comm &lt;file 1&gt; &lt;file2&gt;<\/pre>\n<figure class=\"aligncenter size-large\">The text that\u2019s aligned to the left is the text that\u2019s only present in file 1. The center-aligned text is present only in file 2. And the right-aligned text is present in both the files.<\/figure>\n<\/div>\n<p>By the looks of it, comm command makes the most sense when we\u2019re trying to compare larger files and would like to see everything arranged together.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"The_sort_command_in_Linux\"><\/span>The sort command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The sort command will provide a sorted output of the contents of a file. Let\u2019s use the sort command without any parameters and see the output.<\/p>\n<p>The basic syntax of the sort command is:<\/p>\n<pre>root@webhostc:~# sort &lt;filename&gt;<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"The_export_command_in_Linux\"><\/span>The export command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The export command is specially used when exporting environment variables in runtime. For example, if I wanted to update the bash prompt, I\u2019ll update the PS1 environment variable. The bash prompt will be updated with immediate effect.<\/p>\n<pre>root@webhostc:~# export &lt;variable name&gt;=&lt;value&gt;<\/pre>\n<p>If for some reason, your bash prompt doesn\u2019t update, just type in <strong>bash<\/strong> and you should see the updated terminal prompt.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"The_ssh_command_in_Linux\"><\/span>The ssh command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The ssh command allows us to connect to an external machine on the network with the use of the ssh protocol. The basic syntax of the ssh command is:<\/p>\n<pre>root@webhostc:~#username@ipaddress\r\nor\r\nroot@webhostc:~#username@ipaddress -p 22<\/pre>\n<p>Where <strong>-p<\/strong> represent the ssh port number, it is used only id default ssh port is customized for security reasons<\/p>\n<h2><span class=\"ez-toc-section\" id=\"The_service_command_in_Linux\"><\/span>The service command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The service command in Linux is used for starting and stopping different services within the operating system. The basic syntax of the command is as below.<\/p>\n<pre>root@webhostc:~# service ssh status\r\nroot@webhostc:~# service ssh stop\r\nroot@webhostc:~# service ssh start<\/pre>\n<p>As you can see in the image, the ssh server is running on our system.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"The_ps_kill_and_killall_commands\"><\/span>The ps, kill, and killall commands<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>While we\u2019re on the topic of processes, let\u2019s see how we can find active processes and kill them. To find the running processes, we can simply type <strong>ps<\/strong> in the terminal prompt and get the list of running processes.<\/p>\n<pre>root@webhostc:~# ps\r\nroot@webhostc:~# kill &lt;process ID&gt;\r\nroot@webhostc:~# killall &lt;process name&gt;<\/pre>\n<p>For demonstration purposes, I\u2019m creating a shell script with an infinite loop and will run it in the background.<\/p>\n<p>With the use of the <strong>&amp;<\/strong> symbol, I can pass a process into the background. As you can see, a new bash process with PID 14490 is created.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\">Now, to kill a process with the <strong>kill<\/strong> command, you can type <strong>kill<\/strong> followed b the PID of the process.<\/figure>\n<\/div>\n<div class=\"code-block code-block-5\">\n<div id=\"00000001-f98f0bb4-e1ae-4fe9-be44-1efd3f480d6b\" class=\"_ap_apex_ad\" data-section=\"00000001-f98f0bb4-e1ae-4fe9-be44-1efd3f480d6b\" data-orig-id=\"306c3248-f841-40c0-ae7c-bb2061187e4f\" data-render-time=\"1632280669770\" data-ap-network=\"adpTags\" data-refresh-time=\"1632282110524\" data-timeout=\"4824\">\n<div id=\"ADP_42209_300x250_00000001-f98f0bb4-e1ae-4fe9-be44-1efd3f480d6b\" data-google-query-id=\"CKWMnbLPkfMCFSuArAIdu2sBaA\">\n<div id=\"google_ads_iframe_\/103512698,14629573\/22274416068_11__container__\">But if you do not know the process ID and just want to kill the process with the name, you can make use of the killall command.<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"wp-block-image\">\n<h2 class=\"aligncenter size-large\"><span class=\"ez-toc-section\" id=\"The_df_and_mount_commands\"><\/span>The df and mount commands<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<\/div>\n<p>When working with Linux, the df and mount commands are very efficient utilities to mount filesystems and get details of the file system.<\/p>\n<p>When I say mount, it means that we\u2019ll connect the device to a folder so we can access the files from our filesystem. The default syntax to mount a filesystem is below:<\/p>\n<pre>root@webhostc:~ # mount \/dev\/cdrom \/mnt\r\nroot@webhostc:~ # df -h<\/pre>\n<p>In the above case, <strong>\/dev\/cdrom<\/strong> is the device that needs to be mounted. Usually, a mountable device is found inside the \/dev folder. <strong>\/mnt<\/strong> is the destination folder to mount the device to. You can change it to any folder you want but I\u2019ve used \/mnt as it\u2019s pretty much a system default folder for mounting devices.<\/p>\n<p>To see the mounted devices and get more information about them, we make use of the df command. Just typing <strong>df<\/strong> will give us the data in bytes which is not readable. So we\u2019ll use the<strong> -h<\/strong> parameter to make the data human-readable.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"The_chmod_and_chown_commands\"><\/span>The chmod and chown commands<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The chmod and chown commands give us the functionality to change the file permissions and file ownership are the most important Linux commands you should know.<\/p>\n<p>The main difference between the functions of the two commands is that the chmod command allows changing file permissions, while chown allows us to change the file owners.<\/p>\n<div class=\"code-block code-block-5\">\n<div id=\"00000001-d13e9f45-8edc-4c29-bcec-684b0777226e\" class=\"_ap_apex_ad\" data-section=\"00000001-d13e9f45-8edc-4c29-bcec-684b0777226e\" data-orig-id=\"306c3248-f841-40c0-ae7c-bb2061187e4f\" data-render-time=\"1632280669797\" data-ap-network=\"adpTags\" data-refresh-time=\"1632282111259\" data-timeout=\"4859\">\n<div id=\"ADP_42209_300x250_00000001-d13e9f45-8edc-4c29-bcec-684b0777226e\" data-google-query-id=\"CKeMnbLPkfMCFSuArAIdu2sBaA\">\n<div id=\"google_ads_iframe_\/103512698,14629573\/22274416068_13__container__\">The default syntax for both the commands is <strong>chmod &lt;parameter&gt; filename<\/strong> and <strong>chown &lt;user:group&gt; filename<\/strong><\/div>\n<pre>root@webhostc:~ # chmod +x loop.sh\r\nroot@webhostc:~ #chmod root:root loop.sh<\/pre>\n<div>In the above example, we\u2019re adding executable permissions to the loop.sh file with the <strong>chmod command<\/strong>. Apart from that, with the <strong>chown command<\/strong>, we\u2019ve made it accessible only by root user and users within the root group.<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>As you will notice, the <strong>root root<\/strong> part is now changed to <strong>www-data<\/strong> which is the new user who has full file ownership.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"The_ifconfig_and_traceroute_commands\"><\/span>The ifconfig and traceroute commands<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Moving on to the networking section in Linux, we come across the ifconfig and traceroute commands which will be frequently used if you manage a network.<\/p>\n<p>The ifconfig command will give you the list of all the network interfaces along with the IP addresses, MAC addresses and other information about the interface.<\/p>\n<pre>root@webhostc:~ # ifconfig<\/pre>\n<p>There are multiple parameters that can be used but we\u2019ll work with the basic command here.<\/p>\n<p>When working with traceroute, you can simply specify the IP address, the hostname or the domain name of the endpoint.<\/p>\n<pre>root@webhostc:~ # traceroute &lt;destination address&gt;<\/pre>\n<p>Now obviously, localhost is just one hop (which is the network interface itself). You can try this same command with any other domain name or IP address to see all the routers that your data packets pass through to reach the destination.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"The_wget_command_in_Linux\"><\/span>The wget command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>If you want to download a file from within the terminal, the wget command is one of the handiest command-line utilities available. This will be one of the important Linux commands you should know when working with source files.<\/p>\n<p>When you specify the link for download, it has to directly be a link to the file. If the file cannot be accessed by the wget command, it will simply download the webpage in HTML format instead of the actual file that you wanted.<\/p>\n<p>Let\u2019s try an example. The basic syntax of the wget command is :<\/p>\n<pre>root@webhostc:~ # wget &lt;link to file&gt;\r\nOR\r\nroot@webhostc:~ # wget -c &lt;link to file&gt;<\/pre>\n<p>The <strong>-c<\/strong> argument allows us to resume an interrupted download.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"The_ufw_and_iptables_commands\"><\/span>The ufw and iptables commands<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>UFW(Uncomplicated Firewall &#8211; for Ubuntu) and IPTables are firewall interfaces for the Linux Kernel\u2019s netfilter firewall. IPTables directly passes firewall rules to net filter while UFW configures the rules in IPTables which then sends those rules to netfilter.<\/p>\n<p>Why do we need UFW when we have IPTables? Because IPTables is pretty difficult for a newbie. UFW makes things extremely easy. See the below example where we are trying to allow the port 80 for our webserver.<\/p>\n<pre>root@webhostc:~# iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT\r\nroot@webhostc:~# ufw allow 80<\/pre>\n<p>I\u2019m sure you now know why UFW(Uncomplicated Firewall) is created, Look at how easy the syntax becomes. Both these firewalls are very comprehensive and can allow you to create any kind of configuration required for your network. Learn at least the basics of UFW or IPTables firewall as these are the Linux commands you must know.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Package_Managers_in_Linux\"><\/span>Package Managers in Linux<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Different distros of Linux make use of different package managers. Since we\u2019re working on a Ubuntu server, we have the <strong>apt package manager<\/strong>. But for someone working on a Fedora, Red Hat, Arch, or Centos machine, the package manager will be different.<\/p>\n<ul>\n<li><strong>Debian and Debian-based distros<\/strong> \u2013 apt install &lt;package name&gt;<\/li>\n<li><strong>Arch and Arch-based distros<\/strong> \u2013 pacman -S &lt;package name&gt;<\/li>\n<li><strong>Red Hat and Red Hat-based distros<\/strong> \u2013 yum install &lt;package name&gt;<\/li>\n<li><strong>Fedora and CentOS <\/strong>\u2013 yum install &lt;package&gt;<\/li>\n<\/ul>\n<p>Getting yourself well versed with the package manager of your distribution will make things much easier for you in the long run. So even if you have a GUI based package management tool installed, try an make use of the CLI based tool before you move on to the GUI utility. Add these to your list of Linux commands you must know.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"The_sudo_command_in_Linux\"><\/span>The sudo command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><em>\u201cWith great power, comes great responsibility\u201d<\/em><\/p>\n<p>This is the quote that\u2019s displayed when a sudo enabled user(sudoer) first makes use of the sudo command to escalate privileges. This command is equivalent to having logged in as root (based on what permissions you have as a sudoer).<\/p>\n<pre>non-root-user@webhostc:~# sudo &lt;command you want to run&gt;\r\nPassword:<\/pre>\n<p>Just add the word <strong>sudo <\/strong>before any command that you need to run with escalated privileges and that\u2019s it. It\u2019s very simple to use, but can also be an added security risk if a malicious user gains access to a sudoer.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"The_cal_command_in_Linux\"><\/span>The cal command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Ever wanted to view the calendar in the terminal? Me neither! But there apparently are people who wanted it to happen and well here it is.<\/p>\n<p>The <strong>cal<\/strong> command displays a well-presented calendar on the terminal. Just enter the word cal on your terminal prompt.<\/p>\n<pre>root@webhostc:~# cal\r\nroot@webhostc:~# cal Jun 2021<\/pre>\n<p>Even though I don\u2019t need it, it\u2019s a really cool addition! I\u2019m sure there are people who are terminal fans and this is a really amazing option for them.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"The_alias_command\"><\/span>The alias command<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Do you have some commands that you run very frequently while using the terminal? It could be <strong>rm -r <\/strong>or <strong>ls -l<\/strong>, or it could be something longer like <strong>tar -xvzf<\/strong>. This is one of the productivity-boosting Linux commands you must know.<\/p>\n<p>If you know a command that you run very often, it\u2019s time to create an alias. What\u2019s an alias? In simple terms, it\u2019s another name for a command that you\u2019ve defined.<\/p>\n<pre>root@webhostc:~# alias lsl=&quot;ls -l&quot;\r\nOR\r\nroot@webhostc:~# alias rmd=&quot;rm -r&quot;<\/pre>\n<p>Now every time you enter <strong>lsl<\/strong> or <strong>rmd<\/strong> in the terminal, you\u2019ll receive the output that you\u2019d have received if you had used the full commands.<\/p>\n<p>The examples here are for really small commands that you can still type by hand every time. But in some situations where a command has too many arguments that you need to type, it\u2019s best to create a shorthand version of the same.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"The_dd_command_in_Linux\"><\/span>The dd command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>This command was created to convert and copy files from multiple file system formats. In the current day, the command is simply used to create bootable USB for Linux but there still are some things important you can do with the command.<\/p>\n<p>For example, if I wanted to back up the entire hard drive as is to another drive, I\u2019ll make use of the dd command.<\/p>\n<div class=\"wp-block-syntaxhighlighter-code \">\n<div>\n<pre>root@webhostc:~# dd if = \/dev\/sdb of = \/dev\/sda<\/pre>\n<div id=\"highlighter_694973\" class=\"syntaxhighlighter nogutter syntaxhighlighter td overflow-xscroll important bash\">The <strong>if<\/strong> and <strong>of<\/strong> arguments stand for <strong>input file<\/strong> and <strong>output file<\/strong>.<\/div>\n<\/div>\n<\/div>\n<h2><span class=\"ez-toc-section\" id=\"The_whereis_and_whatis_commands\"><\/span>The whereis and whatis commands<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The names of the commands make it very clear as to their functionality. But let\u2019s demonstrate their functionality to make things more clear.<\/p>\n<p>The <strong>whereis<\/strong> command will output the exact location of any command that you type in after the <strong>whereis<\/strong> command.<\/p>\n<pre>root@webhostc:~# whereis sudo\r\nsudo: \/usr\/bin\/sudo \/usr\/lib\/sudo \/usr\/share\/man\/man8\/sudo.8.gz<\/pre>\n<p>The <strong>whatis<\/strong> command gives us an explanation of what a command actually is. Similar to the whereis command, you\u2019ll receive the information for any command that you type after the <strong>whatis<\/strong> command.<\/p>\n<div class=\"wp-block-syntaxhighlighter-code \">\n<div>\n<pre class=\"syntaxhighlighter nogutter syntaxhighlighter td overflow-xscroll important bash\">root@webhostc:~# whatis sudo<\/pre>\n<\/div>\n<\/div>\n<h2><span class=\"ez-toc-section\" id=\"The_top_command_in_Linux\"><\/span>The top command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>A few sections earlier, we talked about the ps command. You observed that the ps command will output the active processes and end itself.<\/p>\n<p>The top command is like a CLI version of the task manager in Windows. You get a live view of the processes and all the information accompanying those processes like memory usage, CPU usage, etc.<\/p>\n<p>To get the top command, all you need to do is type the word <strong>top<\/strong> in your terminal.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"The_useradd_and_usermod_commands\"><\/span>The useradd and usermod commands<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The <strong>useradd<\/strong> or <strong>adduser<\/strong> commands are the exact same commands where adduser is just a symbolic link to the useradd command. This command allows us to create a new user in Linux.<\/p>\n<pre>root@webhostc:~# useradd webhostc -d \/home\/WHC<\/pre>\n<p>The above command will create a new user named <code class=\"plain plain\">webhostch<\/code> with the home directory as <strong>\/home\/WHC<\/strong>.<\/p>\n<p>The <strong>usermod<\/strong> command, on the other hand, is used to modify existing users. You can modify any value of the user including the groups, the permissions, etc.<\/p>\n<p>For example, if you want to add more groups to the user, you can type in:<\/p>\n<pre>root@webhostc:~# usermod webhost-a -G sudo, audio, mysql<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"The_passwd_command_in_Linux\"><\/span>The passwd command in Linux<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Now that you know how to create new users, let\u2019s also set the password for them. The <strong>passwd<\/strong> command lets you set the password for your own account, or if you have the permissions, set the password for other accounts.<\/p>\n<p>The command usage is pretty simple:<\/p>\n<p>For root<\/p>\n<pre>root@webhostc:~# passwd\r\nNew password:<\/pre>\n<p>For other user<\/p>\n<pre>root@webhostc:~# passwd &lt;username&gt;\r\nNew password:<\/pre>\n<p>If you add the username after <strong>passwd<\/strong>, you can set passwords for other users. Enter the new password twice and you\u2019re done. That\u2019s it! You will have a new password set for the user.<\/p>\n<p>To know about other important commands, <a href=\"https:\/\/chennaiwebhosting.in\/blog\/important-linux-commands-with-examples\/\">click here<\/a><\/p>\n<\/div>\n<\/article>\n","protected":false},"excerpt":{"rendered":"<p>Top 50 Linux Commands you must know as a regular user Here, let us see the top 50 linux commands, used on regular basis ls \u2013 The most frequently used command in Linux to list directories pwd \u2013 Print working directory command in Linux cd \u2013 Linux command to navigate through directories mkdir \u2013 Command [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1665,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"categories":[57,14,13,16,17,11,15],"tags":[95,96,97],"class_list":["post-1604","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-centos-redhat","category-centos-6-rhel-6","category-centos-7-rhel-7","category-debian","category-fedora","category-linux","category-ubuntu","tag-50-top-commands","tag-important-commands","tag-top-50-commands"],"_links":{"self":[{"href":"https:\/\/chennaiwebhosting.in\/blog\/wp-json\/wp\/v2\/posts\/1604","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chennaiwebhosting.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chennaiwebhosting.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chennaiwebhosting.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chennaiwebhosting.in\/blog\/wp-json\/wp\/v2\/comments?post=1604"}],"version-history":[{"count":2,"href":"https:\/\/chennaiwebhosting.in\/blog\/wp-json\/wp\/v2\/posts\/1604\/revisions"}],"predecessor-version":[{"id":1667,"href":"https:\/\/chennaiwebhosting.in\/blog\/wp-json\/wp\/v2\/posts\/1604\/revisions\/1667"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/chennaiwebhosting.in\/blog\/wp-json\/wp\/v2\/media\/1665"}],"wp:attachment":[{"href":"https:\/\/chennaiwebhosting.in\/blog\/wp-json\/wp\/v2\/media?parent=1604"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chennaiwebhosting.in\/blog\/wp-json\/wp\/v2\/categories?post=1604"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chennaiwebhosting.in\/blog\/wp-json\/wp\/v2\/tags?post=1604"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}