{"id":118,"date":"2024-05-07T03:20:13","date_gmt":"2024-05-07T02:20:13","guid":{"rendered":"https:\/\/thevadasan.com\/?p=118"},"modified":"2024-05-07T03:20:13","modified_gmt":"2024-05-07T02:20:13","slug":"essential-linux-commands-every-beginner-should-know","status":"publish","type":"post","link":"https:\/\/thevadasan.com\/?p=118","title":{"rendered":"Essential Linux Commands Every Beginner Should Know"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">Essential Linux Commands Every Beginner Should Know<\/h3>\n\n\n\n<p>Entering the world of Linux can be daunting for beginners, but mastering the command line is a powerful tool in your journey. Linux commands allow you to perform tasks from simple file manipulations to system management. Here, we&#8217;ll cover some fundamental Linux commands that are essential for every beginner. Understanding these commands will help you navigate and manage your Linux environment more effectively.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">1. <code>ls<\/code> &#8211; List Directory Contents<\/h4>\n\n\n\n<ul>\n<li><strong>What it does:<\/strong> Displays the files and directories in the current directory.<\/li>\n\n\n\n<li><strong>Usage:<\/strong> <code>ls<\/code> will list the contents of the current directory. You can add flags like <code>-l<\/code> for a detailed list, and <code>-a<\/code> to show hidden files.<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">ls -la<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">2. <code>cd<\/code> &#8211; Change Directory<\/h4>\n\n\n\n<ul>\n<li><strong>What it does:<\/strong> Changes the current directory to another directory.<\/li>\n\n\n\n<li><strong>Usage:<\/strong> <code>cd [directory]<\/code> moves you into the specified directory. Use <code>cd ..<\/code> to go up one directory level, and <code>cd<\/code> or <code>cd ~<\/code> to return to your home directory.<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">cd \/var\/log<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">3. <code>pwd<\/code> &#8211; Print Working Directory<\/h4>\n\n\n\n<ul>\n<li><strong>What it does:<\/strong> Shows the full path of the current directory.<\/li>\n\n\n\n<li><strong>Usage:<\/strong> Simply type <code>pwd<\/code> to display the path of the directory you&#8217;re currently in.<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">pwd<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">4. <code>mkdir<\/code> &#8211; Make Directory<\/h4>\n\n\n\n<ul>\n<li><strong>What it does:<\/strong> Creates a new directory.<\/li>\n\n\n\n<li><strong>Usage:<\/strong> <code>mkdir [directory-name]<\/code> creates a new directory with the specified name.<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\"> mkdir new_folder<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">5. <code>rmdir<\/code> &#8211; Remove Directory<\/h4>\n\n\n\n<ul>\n<li><strong>What it does:<\/strong> Deletes an empty directory.<\/li>\n\n\n\n<li><strong>Usage:<\/strong> <code>rmdir [directory-name]<\/code> removes the specified empty directory.<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">rmdir old_folder<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">6. <code>touch<\/code> &#8211; Create a New File<\/h4>\n\n\n\n<ul>\n<li><strong>What it does:<\/strong> Creates a new empty file or updates the timestamp of an existing file.<\/li>\n\n\n\n<li><strong>Usage:<\/strong> <code>touch [file-name]<\/code> creates a new file or updates an existing file&#8217;s timestamp.<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">touch example.txt<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">7. <code>rm<\/code> &#8211; Remove Files or Directories<\/h4>\n\n\n\n<ul>\n<li><strong>What it does:<\/strong> Deletes files or directories.<\/li>\n\n\n\n<li><strong>Usage:<\/strong> <code>rm [file-name]<\/code> deletes a file. Use <code>-r<\/code> to recursively delete a directory and its contents.<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">rm example.txt\nrm -r directory_name<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">8. <code>cp<\/code> &#8211; Copy Files or Directories<\/h4>\n\n\n\n<ul>\n<li><strong>What it does:<\/strong> Copies files or directories from one location to another.<\/li>\n\n\n\n<li><strong>Usage:<\/strong> <code>cp  [destination]<\/code> copies the source file or directory to the specified destination.<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">cp original.txt copy.txt<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">9. <code>mv<\/code> &#8211; Move or Rename Files or Directories<\/h4>\n\n\n\n<ul>\n<li><strong>What it does:<\/strong> Moves or renames files or directories.<\/li>\n\n\n\n<li><strong>Usage:<\/strong> <code>mv [original-name] [new-name]<\/code> renames a file or directory, or <code>mv  [destination]<\/code> to move files or directories.<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">mv old_name.txt new_name.txt<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">10. <code>man<\/code> &#8211; Manual Pages<\/h4>\n\n\n\n<ul>\n<li><strong>What it does:<\/strong> Displays the manual page for other commands.<\/li>\n\n\n\n<li><strong>Usage:<\/strong> <code>man [command]<\/code> shows the manual page for the specified command, which includes all possible flags and detailed usage.<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">man ls<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">11. <code>grep<\/code> &#8211; Search Text<\/h4>\n\n\n\n<ul>\n<li><strong>What it does:<\/strong> Searches for patterns within text.<\/li>\n\n\n\n<li><strong>Usage:<\/strong> <code>grep 'pattern' [file]<\/code> searches for the specified pattern within a file. Use <code>-i<\/code> to ignore case sensitivity.<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">grep 'error' log.txt<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">12. <code>cat<\/code> &#8211; Concatenate and Display Files<\/h4>\n\n\n\n<ul>\n<li><strong>What it does:<\/strong> Displays the contents of files and can concatenate multiple files into one output.<\/li>\n\n\n\n<li><strong>Usage:<\/strong> <code>cat [file-name]<\/code> to display the contents of a file, <code>cat file1 file2 > mergedfile<\/code> to concatenate file1 and file2 into a new file called mergedfile.<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">cat example.txt<\/code><\/pre>\n\n\n\n<p>Each of these commands is a stepping stone into the vast capabilities of the Linux command line. As you become more familiar with these basics, you&#8217;ll find yourself seamlessly navigating and manipulating the Linux environment, paving the way for more advanced system management and scripting skills.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Essential Linux Commands Every Beginner Should Know Entering the world of Linux can be daunting for beginners, but mastering the command line is a powerful tool in your journey. Linux commands allow you to perform tasks from simple file manipulations to system management. Here, we&#8217;ll cover some fundamental Linux commands that are essential for every [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":119,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[18,34],"tags":[],"_links":{"self":[{"href":"https:\/\/thevadasan.com\/index.php?rest_route=\/wp\/v2\/posts\/118"}],"collection":[{"href":"https:\/\/thevadasan.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thevadasan.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thevadasan.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thevadasan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=118"}],"version-history":[{"count":3,"href":"https:\/\/thevadasan.com\/index.php?rest_route=\/wp\/v2\/posts\/118\/revisions"}],"predecessor-version":[{"id":132,"href":"https:\/\/thevadasan.com\/index.php?rest_route=\/wp\/v2\/posts\/118\/revisions\/132"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thevadasan.com\/index.php?rest_route=\/wp\/v2\/media\/119"}],"wp:attachment":[{"href":"https:\/\/thevadasan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=118"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thevadasan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=118"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thevadasan.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=118"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}