{"id":75266,"date":"2020-06-12T07:07:21","date_gmt":"2020-06-12T07:07:21","guid":{"rendered":"https:\/\/www.whizlabs.com\/blog\/?p=75266"},"modified":"2021-01-08T08:14:50","modified_gmt":"2021-01-08T08:14:50","slug":"top-basic-linux-commands","status":"publish","type":"post","link":"https:\/\/www.whizlabs.com\/blog\/top-basic-linux-commands\/","title":{"rendered":"Top 20 Basic Linux Commands You Should Know"},"content":{"rendered":"<p><em>Are you a beginner, aspiring to start a career in Linux? Check out these most common basic Linux commands that will help you get started with Linux.<\/em><\/p>\n<p style=\"text-align: justify;\">The world of IT is more vibrant than ever, with many new tools and uniquely diverse development environments emerging every day. Among the many foundational aspects of the IT world, Linux always holds a formidable place. The open-source operating system framework has helped many applications and servers come to life.<\/p>\n<p style=\"text-align: justify;\">Most of the enterprises and technology enthusiasts use Linux as their first preference while many of us are still using Windows on our computers. Learning the basic Linux commands becomes important because you cannot just depend on the GUI alone for using Linux. The various advantages of Linux make it one of the top preferences in the computing world. Getting expertise in Linux commands also helps you in getting a <a href=\"https:\/\/www.whizlabs.com\/blog\/top-5-linux-certifications\/\" target=\"_blank\" rel=\"noopener\">Linux certification<\/a>.<\/p>\n<blockquote><p>Enroll Now: <a href=\"https:\/\/www.whizlabs.com\/linux-certifications\/\" target=\"_blank\" rel=\"noopener noreferrer\">Linux Certification Training Courses<\/a><\/p><\/blockquote>\n<p style=\"text-align: justify;\">First of all, it is open-source with the facility of complete customization. However, if you learn how to use basic Linux commands, then you would have complete control over Linux. You can use Linux directly from the terminal with the help of basic commands. In addition, specific commands are essential for the organization, troubleshooting, and optimization of applications.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_76 ez-toc-wrap-left counter-hierarchy ez-toc-counter ez-toc-custom 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: #ea7e02;color:#ea7e02\" 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: #ea7e02;color:#ea7e02\" 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:\/\/www.whizlabs.com\/blog\/top-basic-linux-commands\/#Understanding_Top_Basic_Linux_Commands\" >Understanding Top Basic Linux Commands<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.whizlabs.com\/blog\/top-basic-linux-commands\/#1_Curl\" >1. Curl<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.whizlabs.com\/blog\/top-basic-linux-commands\/#2_Sudo\" >2. Sudo<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.whizlabs.com\/blog\/top-basic-linux-commands\/#3_Pwd_Command\" >3. Pwd Command<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.whizlabs.com\/blog\/top-basic-linux-commands\/#4_Is_Command\" >4. Is Command<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.whizlabs.com\/blog\/top-basic-linux-commands\/#5_Cat\" >5. Cat<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.whizlabs.com\/blog\/top-basic-linux-commands\/#6_Grep\" >6. Grep<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.whizlabs.com\/blog\/top-basic-linux-commands\/#7_IP_Address_Command\" >7. IP Address Command<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.whizlabs.com\/blog\/top-basic-linux-commands\/#8_History_Command\" >8. History Command<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.whizlabs.com\/blog\/top-basic-linux-commands\/#9_MV\" >9. MV<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.whizlabs.com\/blog\/top-basic-linux-commands\/#10_RM\" >10. RM<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.whizlabs.com\/blog\/top-basic-linux-commands\/#11_Sort_Command\" >11. Sort Command<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/www.whizlabs.com\/blog\/top-basic-linux-commands\/#12_SSH_Command\" >12. SSH Command<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/www.whizlabs.com\/blog\/top-basic-linux-commands\/#13_Echo\" >13. Echo<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/www.whizlabs.com\/blog\/top-basic-linux-commands\/#14_Clear\" >14. Clear<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/www.whizlabs.com\/blog\/top-basic-linux-commands\/#15_CP_Command\" >15. CP Command<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/www.whizlabs.com\/blog\/top-basic-linux-commands\/#16_MKDIR_Command\" >16. MKDIR Command<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/www.whizlabs.com\/blog\/top-basic-linux-commands\/#17_RMDIR_Command\" >17. RMDIR Command<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/www.whizlabs.com\/blog\/top-basic-linux-commands\/#18_CHMOD_Command\" >18. CHMOD Command<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/www.whizlabs.com\/blog\/top-basic-linux-commands\/#19_MAN_Command\" >19. MAN Command<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/www.whizlabs.com\/blog\/top-basic-linux-commands\/#20_Passwd_Command\" >20. Passwd Command<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2 style=\"text-align: justify;\"><span class=\"ez-toc-section\" id=\"Understanding_Top_Basic_Linux_Commands\"><\/span>Understanding Top Basic Linux Commands<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">Many readers might be doubtful about the applicability of Linux commands in all Linux distributions. However, the following\u00a0basic Linux commands\u00a0are applicable in all distributions of Linux. And in case, if anything goes wrong, Linux commands can provide significant triage information for sysadmins and operators.<\/p>\n<p style=\"text-align: justify;\">The following discussion would serve as a Linux commands tutorial in which you can learn about 20 important Linux commands. Each of the commands in the following discussion would help you understand your applications better. You would also find the applications of these commands in Linux development environments, bare-metal infrastructure, containers and virtual machines (VMs).<\/p>\n<h3><span class=\"ez-toc-section\" id=\"1_Curl\"><\/span>1. Curl<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">\u2018Curl\u2019 is the ideal entry among\u00a0basic Linux commands\u00a0for transferring an URL. You can use the \u2018curl\u2019 command for testing the endpoint of an application or its connectivity to upstream service endpoints. In addition, \u2018curl\u2019 could be ideally useful for finding out whether your application can reach another service or the check the health of your service. For example, if your application throws an HTTP 500 error implying that it cannot reach a MongoDB database, then you can find the following code.<\/p>\n<pre style=\"text-align: justify;\">$ curl \u2013I \u2013s myapplication:5000\r\n\r\nHTTP\/1.0 500 INTERNAL SERVER ERROR<\/pre>\n<p style=\"text-align: justify;\">In this case, the \u2018-I\u2019 option dictates the header information while the \u2018-s\u2019 option ensures silencing the response body. Users can check the database endpoint from a local desktop by the following example code.<\/p>\n<pre style=\"text-align: justify;\">$ curl \u2013I \u2013s database:27017\r\n\r\nHTTP\/1.0 200 OK<\/pre>\n<p style=\"text-align: justify;\">Now, you would have to check whether the application can reach other places other than the database from the application host.<\/p>\n<pre style=\"text-align: justify;\">$ curl \u2013I \u2013s\u00a0<a href=\"https:\/\/opensource.com\" target=\"_blank\" rel=\"noopener\">https:\/\/opensource.com<\/a>\r\n\r\nHTTP\/1.0 200 OK<\/pre>\n<p style=\"text-align: justify;\">After this, try to reach the database from the application by trying the database hostname first.<\/p>\n<pre style=\"text-align: justify;\">$ curl database:27017\r\n\r\nCurl: (6) Couldn\u2019t resolve host \u2018database\u2019<\/pre>\n<p style=\"text-align: justify;\">As a result, you can clearly notice that your application could not resolve the database due to the unavailability of the database URL. On the other hand, it is possible that the host does not have a nameserver for resolving the hostname.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"2_Sudo\"><\/span>2. Sudo<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">\u2018Sudo\u2019 is undoubtedly one of the prominent additions among\u00a0basic Linux commands. You can use this command for executing commands with root or superuser privileges. The syntax for the command is \u201c$ sudo &lt;command&gt;\u201d. Some of the functionalities of the \u2018sudo\u2019 command could be evident in the following examples.<\/p>\n<pre style=\"text-align: justify;\">\u201c$ sudo useradd &lt;username&gt;\u201d for adding a new user\r\n\r\n\u201c$ passwd &lt;username&gt;\u201d for setting a password for the new user\r\n\r\n\u201c$ sudo userdel &lt;username&gt;\u201d for deleting the user\r\n\r\n\u201csudo groupdel &lt;groupname&gt;\u201d for deleting a group<\/pre>\n<h3><a href=\"https:\/\/www.whizlabs.com\/red-hat-certified-engineer-rhce\/\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"size-full wp-image-69708 aligncenter\" src=\"https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/sites\/2\/2019\/01\/RHCE-Online-Course.gif\" alt=\"RHCE Online Course\" width=\"728\" height=\"90\" \/><\/a><\/h3>\n<h3><span class=\"ez-toc-section\" id=\"3_Pwd_Command\"><\/span>3. Pwd Command<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">Sometimes, users want to know the location of the directory in which they are working. In this case, the best option among\u00a0basic Linux commands for beginners\u00a0would be the \u2018pwd\u2019 command. The \u2018pwd\u2019 command helps candidates find out the absolute location of the existing working directory. Here is an example of using \u2018pwd\u2019 command.<\/p>\n<pre style=\"text-align: justify;\">root@kali : ~\/Desktop\/Programming# pwd<\/pre>\n<p style=\"text-align: justify;\">The output would be \/root\/Desktop\/Programming<\/p>\n<p style=\"text-align: justify;\">You can clearly notice here how typing \u2018pwd\u2019 in the terminal helps in accessing the absolute location of the working directory.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"4_Is_Command\"><\/span>4. Is Command<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">Another notable addition among basic Linux commands is the \u2018Is\u2019 command. It helps in listing files in a directory. Sysadmins and developers can use this command frequently. In the case of containers, the \u2018Is\u2019 command helps in determining the directory and files of the container image. Furthermore, the \u2018Is\u2019 command helps in the evaluation of your permissions. Here is an example of using \u2018Is\u2019 command.<\/p>\n<pre style=\"text-align: justify;\">$ .\/myapp\r\n\r\nBash: .\/myapp: Permission denied\r\n\r\n$ -Is \u2013I myapp\r\n\r\n-rw-r--r--. 1 root root 33 Jul 21 18:36 myapp<\/pre>\n<p style=\"text-align: justify;\">In the above example, you can find that you cannot run \u2018myapp\u2019 due to an issue with permissions. Upon checking the permissions with \u201cIs \u2013I\u201d, users can find out that the permissions don\u2019t include an \u201cx\u201d or a read and write-only permission.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"5_Cat\"><\/span>5. Cat<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">One of the common additions in almost every\u00a0basic Linux commands cheat sheet\u00a0is the \u2018cat\u2019 command. The \u2018cat\u2019 command is ideal for concatenation and printing files. Users can also issue \u2018cat\u2019 command for checking the contents of dependencies files. In addition, it can also help in confirming the application version you have already built locally. Here is an example of using the \u2018cat\u2019 command.<\/p>\n<pre style=\"text-align: justify;\">$ cat requirements.txt\r\n\r\nflask\r\n\r\nflask_pymongo<\/pre>\n<p style=\"text-align: justify;\">The example presented above helps in checking if your Python Flask application lists Flask as a dependency.<\/p>\n<blockquote>\n<p style=\"text-align: justify;\">Linux blogs are a good source of information about the latest news, trends, technology, and more. Here are the\u00a0<a href=\"https:\/\/www.whizlabs.com\/blog\/best-linux-blogs\/\" target=\"_blank\" rel=\"noopener follow noreferrer\" data-wpel-link=\"internal\">top Linux blogs<\/a>\u00a0that you should follow in 2020 to enhance your knowledge.<\/p>\n<\/blockquote>\n<h3><span class=\"ez-toc-section\" id=\"6_Grep\"><\/span>6. Grep<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">The \u2018grep\u2019 command is ideal for searching file patterns. In addition, \u2018grep\u2019 helps in highlighting relevant lines while looking for specific patterns in the output of another command. You can utilize \u2018grep\u2019 for searching log files and specific processes.<\/p>\n<p style=\"text-align: justify;\">For example, if you want to check whether the Apache Tomcat starts up, the number of lines can be pretty overwhelming.<\/p>\n<p style=\"text-align: justify;\">In this case, you can pipe the output to the \u2018grep\u2019 command for isolating the lines indicating server startup. Here is the code example to provide additional clarity on the example.<\/p>\n<pre style=\"text-align: justify;\">$ cat tomcat.log | grep org.apache.catalina.startup.Catalina.start\r\n\r\n01-Jul-2017 18:03:47.542 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 681 ms<\/pre>\n<h3><span class=\"ez-toc-section\" id=\"7_IP_Address_Command\"><\/span>7. IP Address Command<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">The next important addition among\u00a0basic Linux commands\u00a0is the \u201cIP address\u201d command. If it does not work on your host, then you must have installed the host with iproute2 package. \u201cIP address\u201d command helps in viewing interfaces and IP addresses of an application\u2019s host.<\/p>\n<p style=\"text-align: justify;\">For instance, if a container associated with two networks, then the \u2018IP address\u2019 command can showcase the interface connecting with different networks. The most general application of \u201cIP address\u201d command would be to identify the host\u2019s IP address.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"8_History_Command\"><\/span>8. History Command<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">A prominent addition in\u00a0basic Linux commands cheat sheet\u00a0is the \u201chistory\u201d command. You can find unique variants of the \u2018history\u2019 command for different shells. The command can help you find the history of commands that you have used since the beginning of the session. The most promising application of \u2018history\u2019 command is for logging the commands used for troubleshooting an application.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"9_MV\"><\/span>9. MV<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">The \u201cmv\u201d command is also one of the notable\u00a0basic Linux commands. It helps in moving files and directories from one directory to another. After moving the file\/directory, it is deleted from the working directory. The syntax of the \u2018mv\u2019 command is as follows,<\/p>\n<pre style=\"text-align: justify;\">$ mv &lt;flag&gt; {filename} \/pathname\/<\/pre>\n<h3><span class=\"ez-toc-section\" id=\"10_RM\"><\/span>10. RM<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">Exploring the list of\u00a0basic Linux commands, you are most likely to come across the \u2018rm\u2019 command. The \u2018rm\u2019 command is important for removing files from a directory. The \u2018rm\u2019 command does not facilitate removal of directories by default. However, you cannot restore the content of a file after removal. The syntax of the \u2018rm\u2019 command is as follows,<\/p>\n<pre style=\"text-align: justify;\">$ rm &lt;flag&gt; {filename}<\/pre>\n<p><a href=\"https:\/\/www.whizlabs.com\/comptia-linux-certification-training-lx0-103\/practice-test\/\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"size-full wp-image-68279 aligncenter\" src=\"https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/sites\/2\/2018\/01\/CompTIA-Linux-LPI-LX0-103-Practice-TestsAdd-a-little-bit-of-body-text.jpg\" alt=\"CompTIA Linux+ LPI LX0-103 Practice Tests\" width=\"728\" height=\"90\" srcset=\"https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2018\/01\/CompTIA-Linux-LPI-LX0-103-Practice-TestsAdd-a-little-bit-of-body-text.jpg 728w, https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2018\/01\/CompTIA-Linux-LPI-LX0-103-Practice-TestsAdd-a-little-bit-of-body-text-300x37.jpg 300w, https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2018\/01\/CompTIA-Linux-LPI-LX0-103-Practice-TestsAdd-a-little-bit-of-body-text-640x79.jpg 640w, https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2018\/01\/CompTIA-Linux-LPI-LX0-103-Practice-TestsAdd-a-little-bit-of-body-text-681x84.jpg 681w\" sizes=\"(max-width: 728px) 100vw, 728px\" \/><\/a><\/p>\n<h3><span class=\"ez-toc-section\" id=\"11_Sort_Command\"><\/span>11. Sort Command<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">A\u00a0basic Linux commands cheat sheet\u00a0can help you uncover the significance of \u2018sort\u2019 command also. The \u2018sort\u2019 command helps in alphabetic or numeric sorting of search results. You can sort files, directories and file contents with the \u2018sort\u2019 command. The syntax for the command is as follows,<\/p>\n<pre style=\"text-align: justify;\">$ sort &lt;flag&gt; {filename}<\/pre>\n<h3><span class=\"ez-toc-section\" id=\"12_SSH_Command\"><\/span>12. SSH Command<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">The next important addition among\u00a0top 20 basic Linux commands\u00a0refers directly to the \u2018ssh\u2019 command. It actually presents indications towards a cryptographic network protocol for secure operations of network services on an unsecured network. The general use-cases refer to remote command-line execution. On the other hand, SSH command can also help in securing any network service. Here is the syntax of \u2018ssh\u2019 command running on a slave node for remote access to the master.<\/p>\n<pre style=\"text-align: justify;\">$ ssh &lt;master\u2019s ip&gt;<\/pre>\n<p style=\"text-align: justify;\">The syntax for \u2018ssh\u2019 command running at the master for remote access to the slave node is as follows.<\/p>\n<pre style=\"text-align: justify;\">$ ssh &lt;slave\u2019s ip&gt;<\/pre>\n<h3><span class=\"ez-toc-section\" id=\"13_Echo\"><\/span>13. Echo<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">One of the most\u00a0basic Linux commands\u00a0is the \u2018echo\u2019 command. It helps in writing the arguments into the standard output format. The syntax for the \u2018echo\u2019 command is as follows,<\/p>\n<pre style=\"text-align: justify;\">$ echo \u201c&lt;text&gt;\u201d<\/pre>\n<h3><span class=\"ez-toc-section\" id=\"14_Clear\"><\/span>14. Clear<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">Talking of basics, it is practically impossible to skip the \u2018clear\u2019 command in any\u00a0Linux commands tutorial. The \u2018clear\u2019 command helps in clearing the terminal screen. Actually, the command does not delete the contents and only scrolls them down. Users can clear the screen by just pressing \u201cCtrl+L\u201d on the keyboard. The syntax for the \u2018clear\u2019 command is as follows,<\/p>\n<pre style=\"text-align: justify;\">$ clear<\/pre>\n<h3><span class=\"ez-toc-section\" id=\"15_CP_Command\"><\/span>15. CP Command<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">This is obviously one of the important\u00a0basic Linux commands for beginners\u00a0to learn working with files on Linux terminal. The \u2018cp\u2019 command helps in copying files and directories. One copy of the copied file or directory would still be present in the working directory. The syntax for the \u2018cp\u2019 command is as follows,<\/p>\n<pre style=\"text-align: justify;\">$ cp &lt;flag&gt; {filename} \/pathname\/<\/pre>\n<blockquote><p>Preparing for\u00a0CompTIA Linux+ LX0-104 Certification? Here&#8217;s <a href=\"https:\/\/www.whizlabs.com\/blog\/lx0-104-certification-preparation-guide\/\" target=\"_blank\" rel=\"noopener noreferrer\">how to prepare for\u00a0CompTIA Linux+ LX0-104 Certification<\/a>.<\/p><\/blockquote>\n<h3><span class=\"ez-toc-section\" id=\"16_MKDIR_Command\"><\/span>16. MKDIR Command<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">The most important addition among\u00a0basic Linux commands\u00a0is undoubtedly the \u2018mkdir\u2019 command. The \u2018mkdir\u2019 command is ideal for the creation of new directories. The syntax for the \u2018mkdir\u2019 command is as follows,<\/p>\n<pre style=\"text-align: justify;\">$ mkdir &lt;flag&gt; {directoryname} \/pathname\/<\/pre>\n<h3><span class=\"ez-toc-section\" id=\"17_RMDIR_Command\"><\/span>17. RMDIR Command<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">After a look at the above entries among Linux commands, the \u2018rmdir\u2019 command might be very clear to understand. The \u2018rmdir\u2019 command helps in removing specific directories. The command can remove only an empty directory albeit with certain flags that could be deployed only for deleting non-empty directories. The syntax of the \u2018rmdir\u2019 command is as follows.<\/p>\n<pre style=\"text-align: justify;\">$ rmdir &lt;flag&gt; {directoryname}<\/pre>\n<h3><span class=\"ez-toc-section\" id=\"18_CHMOD_Command\"><\/span>18. CHMOD Command<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">The \u2018chmod\u2019 command is ideal for changing the access permissions for directories and files. Take the following example into consideration,<\/p>\n<pre style=\"text-align: justify;\">[xyz@localhost ~]$ cat chmodtest.sh\r\n\r\n#!\/bin\/sh\r\n\r\nEcho \u201cThis file is to test file permissions.\u201d\r\n\r\n[xyz@localhost ~]$<\/pre>\n<p style=\"text-align: justify;\">When you try to run the newly created file \u2018chmodtest.sh\u2019, you will encounter an error. It can be executable only after modification of permissions of the file through using \u2018chmod\u2019 command. Here is the syntax of the \u2018chmod\u2019 command.<\/p>\n<pre style=\"text-align: justify;\">$ chmod &lt;permissions of user, group, others&gt; {filename}<\/pre>\n<h3><span class=\"ez-toc-section\" id=\"19_MAN_Command\"><\/span>19. MAN Command<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">The unique addition among\u00a0basic Linux commands\u00a0is the \u2018man\u2019 command. It helps in obtaining the complete documentation or manual for any command or tool in Linux. The syntax for the \u2018man\u2019 command is as follows.<\/p>\n<pre style=\"text-align: justify;\">$ man command_name<\/pre>\n<p style=\"text-align: justify;\">For example, if you want the documentation for \u2018mkdir\u2019 command, then you can use the command \u201cman mkdir\u201d for obtaining the same.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"20_Passwd_Command\"><\/span>20. Passwd Command<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">The final addition among the top 20 basic Linux commands refers to the \u2018passwd\u2019 command. The \u2018passwd\u2019 command is ideal for changing the user account password in Linux.<\/p>\n<p style=\"text-align: justify;\">Therefore, you can just type in the \u2018passwd\u2019 command for changing the password of an existing running account. On the other hand, if you are a root user, then you have to use \u201csudo passwd username\u201d for changing the password of another user.<\/p>\n<blockquote>\n<p style=\"text-align: justify;\">Preparing for a Linux interview? Go through this definitive set of top 60\u00a0<a href=\"https:\/\/www.whizlabs.com\/blog\/top-linux-interview-questions-answers\/\" target=\"_blank\" rel=\"noopener follow noreferrer\" data-wpel-link=\"internal\">Linux Interview Questions<\/a>\u00a0Answers and get ready to ace the interview.<\/p>\n<\/blockquote>\n<h4 style=\"text-align: justify;\">Bottom Line<\/h4>\n<p style=\"text-align: justify;\">Now, you must be feeling confident about starting your learning journey on the Linux platform. Awareness of\u00a0basic Linux commands\u00a0mentioned here can help you use the terminal effectively. In addition, you can be more confident and efficient in carrying out different tasks on Linux effortlessly. However, the 20 commands mentioned here are not the only commands for mastering Linux basics. There are many other commands which can strengthen your Linux expertise considerably.<\/p>\n<p style=\"text-align: justify;\">On a concluding note, you can clearly note that basic commands improve the capabilities for troubleshooting. In addition, the basic commands can also help in identifying the ideal development environment for your applications. Furthermore, knowledge of basic commands improves your capabilities for effective collaboration to ensure promising resolution of issues with your application.<\/p>\n<p style=\"text-align: justify;\">So, start learning the basic commands of Linux right now for a promising career ahead. If you&#8217;re aspiring to get certified in Linux, check out our <a href=\"https:\/\/www.whizlabs.com\/linux-certifications\/\" target=\"_blank\" rel=\"noopener noreferrer\">Linux certification training courses<\/a> and take the right step to boost your career!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Are you a beginner, aspiring to start a career in Linux? Check out these most common basic Linux commands that will help you get started with Linux. The world of IT is more vibrant than ever, with many new tools and uniquely diverse development environments emerging every day. Among the many foundational aspects of the IT world, Linux always holds a formidable place. The open-source operating system framework has helped many applications and servers come to life. Most of the enterprises and technology enthusiasts use Linux as their first preference while many of us are still using Windows on our [&hellip;]<\/p>\n","protected":false},"author":13,"featured_media":75277,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[14],"tags":[3394,3395,3393,3397,3396],"class_list":["post-75266","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","tag-basic-linux-commands","tag-basic-linux-commands-cheat-sheet","tag-basic-linux-commands-for-beginners","tag-linux-commands-tutorial","tag-top-20-basic-linux-commands"],"uagb_featured_image_src":{"full":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2020\/06\/Top20_Basic_Linux_Commands.png",600,315,false],"thumbnail":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2020\/06\/Top20_Basic_Linux_Commands-150x150.png",150,150,true],"medium":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2020\/06\/Top20_Basic_Linux_Commands-300x158.png",300,158,true],"medium_large":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2020\/06\/Top20_Basic_Linux_Commands.png",600,315,false],"large":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2020\/06\/Top20_Basic_Linux_Commands.png",600,315,false],"1536x1536":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2020\/06\/Top20_Basic_Linux_Commands.png",600,315,false],"2048x2048":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2020\/06\/Top20_Basic_Linux_Commands.png",600,315,false],"profile_24":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2020\/06\/Top20_Basic_Linux_Commands.png",24,13,false],"profile_48":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2020\/06\/Top20_Basic_Linux_Commands.png",48,25,false],"profile_96":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2020\/06\/Top20_Basic_Linux_Commands.png",96,50,false],"profile_150":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2020\/06\/Top20_Basic_Linux_Commands.png",150,79,false],"profile_300":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2020\/06\/Top20_Basic_Linux_Commands.png",300,158,false],"tptn_thumbnail":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2020\/06\/Top20_Basic_Linux_Commands-250x250.png",250,250,true],"web-stories-poster-portrait":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2020\/06\/Top20_Basic_Linux_Commands.png",600,315,false],"web-stories-publisher-logo":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2020\/06\/Top20_Basic_Linux_Commands.png",96,50,false],"web-stories-thumbnail":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2020\/06\/Top20_Basic_Linux_Commands.png",150,79,false]},"uagb_author_info":{"display_name":"Pavan Gumaste","author_link":"https:\/\/www.whizlabs.com\/blog\/author\/pavan\/"},"uagb_comment_info":150,"uagb_excerpt":"Are you a beginner, aspiring to start a career in Linux? Check out these most common basic Linux commands that will help you get started with Linux. The world of IT is more vibrant than ever, with many new tools and uniquely diverse development environments emerging every day. Among the many foundational aspects of the&hellip;","_links":{"self":[{"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/posts\/75266","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/comments?post=75266"}],"version-history":[{"count":9,"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/posts\/75266\/revisions"}],"predecessor-version":[{"id":76709,"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/posts\/75266\/revisions\/76709"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/media\/75277"}],"wp:attachment":[{"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/media?parent=75266"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/categories?post=75266"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/tags?post=75266"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}