<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Sahil</title>
    <description>The latest articles on DEV Community by Sahil (@issahil404).</description>
    <link>https://dev.to/issahil404</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1382181%2F265eb9a4-b62a-43d2-9de6-b31ef4b26a50.png</url>
      <title>DEV Community: Sahil</title>
      <link>https://dev.to/issahil404</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/issahil404"/>
    <language>en</language>
    <item>
      <title>Linux Terminal for Beginners - Mastering File Manipulation</title>
      <dc:creator>Sahil</dc:creator>
      <pubDate>Wed, 09 Oct 2024 13:46:00 +0000</pubDate>
      <link>https://dev.to/issahil404/linux-terminal-for-beginners-mastering-file-manipulation-1co4</link>
      <guid>https://dev.to/issahil404/linux-terminal-for-beginners-mastering-file-manipulation-1co4</guid>
      <description>&lt;p&gt;Welcome back! In our &lt;a href="https://blog.theenthusiast.dev/posts/linux-terminal-for-beginners-mastering-navigation-basics/" rel="noopener noreferrer"&gt;last article&lt;/a&gt;, we learned how to navigate the file system using the Linux terminal. Today, we'll learn how to manipulate files themselves. We'll cover creating, moving, copying, and renaming files - all from the command line.&lt;/p&gt;

&lt;p&gt;Before we start, I'd like to introduce you to &lt;a href="https://app.warp.dev/referral/REZXZL" rel="noopener noreferrer"&gt;Warp&lt;/a&gt;, a modern terminal that can make your command-line experience smoother and more intuitive, especially if you're new to terminal interfaces. Warp offers features like auto-suggestions, clear output formatting, and a user-friendly interface. The best part? It's completely free to use! If you're interested in trying it out, you can &lt;a href="https://app.warp.dev/referral/REZXZL" rel="noopener noreferrer"&gt;download Warp here&lt;/a&gt;. Don't worry if you prefer to stick with your current terminal - all the commands we'll learn today work in any standard terminal.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting Up Our Workspace
&lt;/h2&gt;

&lt;p&gt;Let's start by creating a workspace that we'll use throughout this article. This will ensure we're all starting from the same point. Follow these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open your terminal&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fph95ya3fq5kpn239dxpk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fph95ya3fq5kpn239dxpk.png" alt="terminal" width="800" height="557"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Navigate to your home directory
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;cd&lt;/span&gt; ~
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Th &lt;code&gt;cd ~&lt;/code&gt; command changes your current directory to your home directory, providing a consistent starting point for everyone.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a new directory called "terminal_practice"
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;mkdir &lt;/span&gt;terminal_practice
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;mkdir&lt;/code&gt; command stands for "make directory" and creates a new folder named "terminal_practice".&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbx54nxm3u3xoc3ews8hv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbx54nxm3u3xoc3ews8hv.png" alt="Image description" width="800" height="557"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Move into this new directory
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;cd &lt;/span&gt;terminal_practice
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command changes your current directory to the newly created "terminal_practice" folder.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4fp7n274dw2r1u2utei0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4fp7n274dw2r1u2utei0.png" alt="Image description" width="800" height="557"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create some subdirectories
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;mkdir &lt;/span&gt;Documents
   &lt;span class="nb"&gt;mkdir &lt;/span&gt;Projects
   &lt;span class="nb"&gt;mkdir &lt;/span&gt;Personal
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Create three new directories (Documents, Projects, and Personal) using the `mkdir` command inside the "terminal_practice" folder.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn4lh43apnptdffzhocx4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn4lh43apnptdffzhocx4.png" alt="Image description" width="800" height="557"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Use the &lt;code&gt;ls&lt;/code&gt; command to verify our setup
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;ls&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;ls&lt;/code&gt; command lists the contents of the current directory. You should see the three directories we just created: Documents, Projects, and Personal.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr3dk8sik2ff9jimlmie9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr3dk8sik2ff9jimlmie9.png" alt="Image description" width="800" height="557"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Navigating Between Directories (&lt;code&gt;cd&lt;/code&gt;)
&lt;/h2&gt;

&lt;p&gt;Now, let's learn some advanced navigation tricks. We've used &lt;code&gt;cd&lt;/code&gt; to move into directories, but navigating a complex directory structure requires more finesse. Let's explore this with a hypothetical directory structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;terminal_practice/
├── Documents/
│   ├── Reports/
│   │   └── quarterly_report.txt
│   └── Memos/
│       └── team_update.txt
├── Projects/
│   ├── WebDev/
│   │   └── index.html
│   └── DataAnalysis/
│       └── data.csv
└── Personal/
    ├── Photos/
    │   └── vacation.jpg
    └── Notes/
        └── ideas.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's learn how to navigate this structure, assume that we are in "terminal_practice" directory:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Start by moving into the Documents directory
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;cd &lt;/span&gt;Documents
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command changes your current directory to the Documents subdirectory.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Now, let's move into the Reports subdirectory
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;cd &lt;/span&gt;Reports
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You're now in the Reports directory, two levels deep from terminal_practice.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;To move back up to the Documents directory
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;cd&lt;/span&gt; ..
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;..&lt;/code&gt; notation represents the parent directory. This command moves you up one level in the directory structure.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;To move all the way back to terminal_practice from Reports
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;cd&lt;/span&gt; ../..
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This moves up two levels at once: first out of Reports, then out of Documents.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Now, let's move to the DataAnalysis directory with a single command
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;cd &lt;/span&gt;Projects/DataAnalysis
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This navigates into Projects, then into DataAnalysis in one step.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;To move from DataAnalysis to Photos, we can combine going up and down
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;cd&lt;/span&gt; ../../Personal/Photos
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This goes up two levels (to terminal_practice), then down into Personal and Photos.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Verify where you are
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;pwd&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;pwd&lt;/code&gt; command, which stands for "print working directory", shows your current location in the file system. You should see &lt;code&gt;/path/to/terminal_practice/Personal/Photos&lt;/code&gt;.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You can also use absolute paths to jump to any directory from anywhere. For example, to go directly to the Memos directory from anywhere:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;cd&lt;/span&gt; ~/terminal_practice/Documents/Memos
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;~&lt;/code&gt; represents your home directory, so this works regardless of your current location.&lt;/p&gt;

&lt;p&gt;Remember, you can always use &lt;code&gt;ls&lt;/code&gt; to list the contents of your current directory if you're unsure of where you are or what's around you.&lt;/p&gt;

&lt;p&gt;I hope it's clear how you can efficiently navigate complex directory structures using &lt;code&gt;cd&lt;/code&gt; with relative and absolute paths&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating Files: The Touch Command (&lt;code&gt;touch&lt;/code&gt;)
&lt;/h2&gt;

&lt;p&gt;Now that we can navigate effectively, let's create some files to work with. We'll use the &lt;code&gt;touch&lt;/code&gt; command for this purpose.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;touch&lt;/code&gt; command is a simple tool used to create new, empty files. Its basic format is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;touch &lt;/span&gt;filename
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When you use &lt;code&gt;touch&lt;/code&gt; with a filename that doesn't exist, it creates a new, empty file with that name. If the file already exists, &lt;code&gt;touch&lt;/code&gt; updates its timestamp without changing its content.&lt;/p&gt;

&lt;p&gt;Let's practice using the &lt;code&gt;touch&lt;/code&gt; command:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Move to the Documents folder
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;cd &lt;/span&gt;Documents
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This changes your current directory to Documents.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr839n1l1tnscbs113bfn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr839n1l1tnscbs113bfn.png" alt="Image description" width="800" height="557"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a new file:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;touch &lt;/span&gt;note.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;touch&lt;/code&gt; command creates a new, empty file named "note.txt" in the current directory.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1n2x6yavkw3fselrwtsc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1n2x6yavkw3fselrwtsc.png" alt="Image description" width="800" height="557"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Verify that the file was created:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;ls&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This lists the contents of the current directory. You should see "note.txt" listed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzibvj5hdy9phcpy5tevt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzibvj5hdy9phcpy5tevt.png" alt="Image description" width="800" height="557"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Let's create files in Projects and Personal as well:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;cd&lt;/span&gt; ../Projects
   &lt;span class="nb"&gt;touch &lt;/span&gt;project_ideas.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This moves to the Projects directory and creates a new file named "project_ideas.txt".&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3x5t41304vx557ms0spu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3x5t41304vx557ms0spu.png" alt="Image description" width="800" height="557"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;cd&lt;/span&gt; ../Personal
   &lt;span class="nb"&gt;touch &lt;/span&gt;todo.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This moves to the Personal directory and creates a new file named "todo.txt".&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhfy4qkgugvyxkg2nve4r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhfy4qkgugvyxkg2nve4r.png" alt="Image description" width="800" height="557"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Moving Files: Organizing With the &lt;code&gt;mv&lt;/code&gt; Command
&lt;/h2&gt;

&lt;p&gt;Now let's learn how to move files using the &lt;code&gt;mv&lt;/code&gt; command. The &lt;code&gt;mv&lt;/code&gt; command is used to move files or directories from one location to another. Its basic format is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mv source &lt;/span&gt;destination
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, &lt;code&gt;source&lt;/code&gt; is the file or directory you want to move, and &lt;code&gt;destination&lt;/code&gt; is where you want to move it to.&lt;/p&gt;

&lt;p&gt;Let's practice using the &lt;code&gt;mv&lt;/code&gt; command:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Move to the Documents folder:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;cd&lt;/span&gt; ../Documents
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This changes your current directory back to Documents.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdm3g3ucluddwgz4u5cgc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdm3g3ucluddwgz4u5cgc.png" alt="Image description" width="800" height="557"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Move the note.txt file from Documents to Personal:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;mv &lt;/span&gt;note.txt ../Personal
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;mv&lt;/code&gt; command moves "note.txt" from the current directory (Documents) to the Personal directory. The &lt;code&gt;..&lt;/code&gt; means "up one directory level".&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv1b3e4iuy4usgd5de8lk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv1b3e4iuy4usgd5de8lk.png" alt="Image description" width="800" height="557"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Check if the move was successful:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;ls&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This should show that "note.txt" is no longer in the Documents directory.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flz9r2chzn7vxkehtgsrn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flz9r2chzn7vxkehtgsrn.png" alt="Image description" width="800" height="557"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;cd&lt;/span&gt; ../Personal
   &lt;span class="nb"&gt;ls&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This moves you to the Personal directory and lists its contents. You should see "note.txt" listed here now.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnooyhfuaalfwrqal8znr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnooyhfuaalfwrqal8znr.png" alt="Image description" width="800" height="557"&gt;&lt;/a&gt;&lt;br&gt;
Remember, when using &lt;code&gt;mv&lt;/code&gt;, be careful with your source and destination paths. If you specify an incorrect path, you might move files to unintended locations. Always double-check your paths before executing the command.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;mv&lt;/code&gt; command can also be used to rename files, we'll cover this in a later section in this article.&lt;/p&gt;
&lt;h2&gt;
  
  
  Copying Files: Creating Backups With the &lt;code&gt;cp&lt;/code&gt; Command
&lt;/h2&gt;

&lt;p&gt;Sometimes, you want to create a copy of a file. For this, we use the &lt;code&gt;cp&lt;/code&gt; command. The &lt;code&gt;cp&lt;/code&gt; command allows you to duplicate files or directories. Its basic format is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cp source &lt;/span&gt;destination
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, &lt;code&gt;source&lt;/code&gt; is the file you want to copy, and &lt;code&gt;destination&lt;/code&gt; is where you want the copy to be placed (this can be a directory or a new filename).&lt;/p&gt;

&lt;p&gt;Let's practice using &lt;code&gt;cp&lt;/code&gt; command:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Copy the todo.txt file from Personal to Documents:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;cp &lt;/span&gt;todo.txt ../Documents
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates a copy of "todo.txt" in the Documents directory while leaving the original in place.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjbyqwhi3hf8806kmox4f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjbyqwhi3hf8806kmox4f.png" alt="Image description" width="800" height="557"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Verify the copy:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;ls&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This should show "todo.txt" still present in the Personal directory.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhwcq88qy1tfhqmgsjj3i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhwcq88qy1tfhqmgsjj3i.png" alt="Image description" width="800" height="557"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;cd&lt;/span&gt; ../Documents
   &lt;span class="nb"&gt;ls&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This moves you to the Documents directory and lists its contents. You should now see "todo.txt" here as well.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6qg19xr4etyyvscmf11p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6qg19xr4etyyvscmf11p.png" alt="Image description" width="800" height="557"&gt;&lt;/a&gt;&lt;br&gt;
Remember, &lt;code&gt;cp&lt;/code&gt; doesn't move the original file, it creates a duplicate. This means you can safely create copies without affecting the original file. However, be cautious not to overwrite existing files unintentionally.&lt;/p&gt;
&lt;h2&gt;
  
  
  Renaming Files: Giving Files Meaningful Names
&lt;/h2&gt;

&lt;p&gt;To rename files, we also use the &lt;code&gt;mv&lt;/code&gt; command. While &lt;code&gt;mv&lt;/code&gt; is primarily used for moving files, it can also rename files when used within the same directory. The basic format for renaming is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mv &lt;/span&gt;oldname newname
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, &lt;code&gt;oldname&lt;/code&gt; is the current name of the file, and &lt;code&gt;newname&lt;/code&gt; is the new name you want to give it.&lt;/p&gt;

&lt;p&gt;Let's practice renaming files with the &lt;code&gt;mv&lt;/code&gt; command:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Rename todo.txt in the Documents folder:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;mv &lt;/span&gt;todo.txt tasks.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This renames the file "todo.txt" to "tasks.txt" in the current directory (Documents).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F91odh54ps04cvdqs8cys.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F91odh54ps04cvdqs8cys.png" alt="Image description" width="800" height="557"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Check the result:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;ls&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should now see "tasks.txt" instead of "todo.txt" in the Documents directory.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk2gn552vfy4og7bh85yi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk2gn552vfy4og7bh85yi.png" alt="Image description" width="800" height="557"&gt;&lt;/a&gt;&lt;br&gt;
Remember, when renaming files with &lt;code&gt;mv&lt;/code&gt;, you're essentially "moving" the file to a new name in the same directory. Be careful not to accidentally move the file to a different directory by specifying a path in the new name.&lt;/p&gt;

&lt;h2&gt;
  
  
  Practice Mission: Organizing Your Digital Space
&lt;/h2&gt;

&lt;p&gt;Now, let's practice what we've learned:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Navigate to the Projects folder and create a new file&lt;/li&gt;
&lt;li&gt;Make a copy of this file in Documents&lt;/li&gt;
&lt;li&gt;Move to Documents and rename the copy&lt;/li&gt;
&lt;li&gt;Move the original file from Projects to Personal&lt;/li&gt;
&lt;li&gt;Check the contents of all directories&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Wrapping Up
&lt;/h2&gt;

&lt;p&gt;Congratulations! You've just learned some powerful file management skills:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Using &lt;code&gt;..&lt;/code&gt; to navigate up directories&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;touch&lt;/code&gt;: Create empty files&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;mv&lt;/code&gt;: Move or rename files&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;cp&lt;/code&gt;: Copy files&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Remember, practice makes perfect. Try using these commands to organize some of your own files. Start small and gradually work your way up to larger organizations.&lt;/p&gt;

&lt;p&gt;If you found yourself enjoying working in the terminal today, you might want to give Warp a try. Its modern interface and helpful features like auto-suggestions and clear output formatting can make your terminal experience even more enjoyable and productive. And remember, it's completely free to use! You can &lt;a href="https://app.warp.dev/referral/REZXZL" rel="noopener noreferrer"&gt;download Warp here&lt;/a&gt; if you're interested in enhancing your terminal experience.&lt;/p&gt;

&lt;h2&gt;
  
  
  Show Off Your Terminal Mastery!
&lt;/h2&gt;

&lt;p&gt;You've accomplished a lot today! Why not share your achievements?&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Complete the practice mission&lt;/li&gt;
&lt;li&gt;Take a screenshot of your terminal showing the commands you used&lt;/li&gt;
&lt;li&gt;Post it on Twitter or LinkedIn&lt;/li&gt;
&lt;li&gt;Tag me (&lt;a class="mentioned-user" href="https://dev.to/introvertedbot"&gt;@introvertedbot&lt;/a&gt; on Twitter)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Keep exploring, and I'll see you in the next lesson!&lt;/p&gt;

</description>
      <category>linux</category>
      <category>terminal</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Linux Terminal for Beginners - Mastering Navigation Basics</title>
      <dc:creator>Sahil</dc:creator>
      <pubDate>Sun, 06 Oct 2024 05:40:00 +0000</pubDate>
      <link>https://dev.to/issahil404/linux-terminal-for-beginners-mastering-navigation-basics-2lld</link>
      <guid>https://dev.to/issahil404/linux-terminal-for-beginners-mastering-navigation-basics-2lld</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Originally published on: &lt;a href="https://blog.theenthusiast.dev/posts/linux-terminal-for-beginners-mastering-navigation-basics/" rel="noopener noreferrer"&gt;blog.theenthusiast.dev&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Imagine this: You've been using your computer for a while, and your Documents folder has become a catch-all for every file you've saved. You want to bring some order to this chaos, create a structure for your projects, and set up a system for personal files. Doing this with a mouse seems tedious. There must be a faster, more efficient way, right?&lt;/p&gt;

&lt;p&gt;Enter the &lt;strong&gt;terminal&lt;/strong&gt; --&amp;gt; your new friend for doing things faster. Before we start organizing, we need to learn how to navigate our digital space efficiently. This is where the power of the terminal really shines.&lt;/p&gt;

&lt;h1&gt;
  
  
  What is a terminal?
&lt;/h1&gt;

&lt;p&gt;Think of the terminal as a way to chat with the computer.&lt;br&gt;
Instead of painfully clicking through folders, we can just ask the computer through the terminal to do exactly what we want.&lt;br&gt;
The advantages are huge:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Its often faster than using a mouse for many tasks&lt;/li&gt;
&lt;li&gt;It allows you to perform powerful operations not possible with normal clicking and dragging.&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;
  
  
  Your First Step: Opening the Terminal
&lt;/h1&gt;

&lt;p&gt;Let's start our organizational journey by opening the terminal:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;On Ubuntu: Press Ctrl + Alt + T&lt;/li&gt;
&lt;li&gt;On Mac: Press Cmd + Space, type "Terminal", press Enter&lt;/li&gt;
&lt;li&gt;On other Linux systems: Look for "Terminal" in your applications menu&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When you open it, you'll see something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgbdmo9jljbb0d777ee3t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgbdmo9jljbb0d777ee3t.png" alt="terminal-screenshot"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are 2 lines:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;First one is printing my last login time or using time&lt;/li&gt;
&lt;li&gt;The second line is important, it prints my username and my system's name in this format : &lt;code&gt;username@computername:~$&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is your computer's way of saying, "I'm ready. What would you like me to do?"&lt;/p&gt;
&lt;h1&gt;
  
  
  Talk to your Terminal
&lt;/h1&gt;
&lt;h2&gt;
  
  
  Where am I? (&lt;code&gt;pwd&lt;/code&gt;)
&lt;/h2&gt;

&lt;p&gt;Before doing anything let's check where we are right now:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;pwd&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;pwd&lt;/code&gt; stands for "Print Working Directory". This command shows you the full path of the directory (folder) you're currently in.&lt;/p&gt;

&lt;p&gt;For me, it's looking like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fygqmty14errkqr34cb6n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fygqmty14errkqr34cb6n.png" alt="terminal-pwd"&gt;&lt;/a&gt;&lt;br&gt;
It'll print something similar to this. Instead of my username, you'll see your username.&lt;/p&gt;

&lt;p&gt;This is your home directory, where we'll start our organization.&lt;/p&gt;
&lt;h2&gt;
  
  
  What's here? (&lt;code&gt;ls&lt;/code&gt;)
&lt;/h2&gt;

&lt;p&gt;Ok, we've understood where we are, but now let's find out what's in this directory (folder)&lt;br&gt;
Think of it like relocating a new place, first you understood where you are, now you need to see what's the place has.&lt;/p&gt;

&lt;p&gt;Type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will list all the files and folders in your current location.&lt;/p&gt;

&lt;p&gt;For me, it shows something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe5x6w2q719bhazzkpq98.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe5x6w2q719bhazzkpq98.png" alt="terminal ls command"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Damn, I have too much garbage in here, you might see less things or you might have a lot of garbage like me.&lt;/p&gt;

&lt;p&gt;You should see several folders, including Documents. We'll be working with this folder.&lt;/p&gt;

&lt;h2&gt;
  
  
  Moving into a folder (&lt;code&gt;cd&lt;/code&gt;)
&lt;/h2&gt;

&lt;p&gt;Let's move into the Documents folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;Documents
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;cd&lt;/code&gt; stands for "change directory". This command moves you into the specified folder.&lt;/p&gt;

&lt;p&gt;This is how it looks for me:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwz1gnw9dp5s4qph1kqmf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwz1gnw9dp5s4qph1kqmf.png" alt="terminal cd command"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Checking our new location (pwd)
&lt;/h2&gt;

&lt;p&gt;Let's confirm where we are now:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;pwd&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For me, its showing something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyavnft05dvx9lkdo8zla.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyavnft05dvx9lkdo8zla.png" alt="terminal pwd command"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I have moved from my home directory to Documents directory, if you have followed along then you'll see the same thing.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's in Documents? (&lt;code&gt;ls&lt;/code&gt;)
&lt;/h2&gt;

&lt;p&gt;Let's see what's in the Documents folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will show you all the files and folders that have been piling up in your Documents folder.&lt;/p&gt;

&lt;p&gt;For me, its something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzyaq6rve35br59pmbamu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzyaq6rve35br59pmbamu.png" alt="terminal ls command"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Creating Our Organizational Structure
&lt;/h1&gt;

&lt;p&gt;Now that we're in the Documents folder and can see its contents, let's start creating some order.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating new folders (&lt;code&gt;mkdir&lt;/code&gt;)
&lt;/h2&gt;

&lt;p&gt;Let's create two new folders to separate our projects and personal files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir &lt;/span&gt;Projects
&lt;span class="nb"&gt;mkdir &lt;/span&gt;Personal
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;mkdir&lt;/code&gt; stands for "make directory". This command creates a new folder with the name you specify.&lt;/p&gt;

&lt;h2&gt;
  
  
  Verifying our new folders (&lt;code&gt;ls&lt;/code&gt;)
&lt;/h2&gt;

&lt;p&gt;Let's check if our new folders were created:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should now see Projects and Personal listed, along with your existing files and folders.&lt;/p&gt;

&lt;p&gt;For me, its something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0o15yf0cwyhegnt55lmy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0o15yf0cwyhegnt55lmy.png" alt="terminal mkdir ls command"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I have too many folders but you can see we have successfully created "Personal" and "Projects" folder.&lt;/p&gt;

&lt;h1&gt;
  
  
  Moving Between Folders
&lt;/h1&gt;

&lt;p&gt;Now that we have our basic structure, let's practice moving around.&lt;/p&gt;

&lt;h2&gt;
  
  
  Moving into a subfolder (&lt;code&gt;cd&lt;/code&gt;)
&lt;/h2&gt;

&lt;p&gt;Let's move into the Projects folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;Projects
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Checking our location (&lt;code&gt;pwd&lt;/code&gt;)
&lt;/h2&gt;

&lt;p&gt;Confirm where we are:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;pwd&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is how it looks for me:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fts6bh1ju35wh7x5gdt0m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fts6bh1ju35wh7x5gdt0m.png" alt="terminal projects pwd command"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Going back up (&lt;code&gt;cd ..&lt;/code&gt;)
&lt;/h2&gt;

&lt;p&gt;To get back to the parent folder (Documents in this case):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ..
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;cd ..&lt;/code&gt; moves you up one level in the directory structure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Returning home (&lt;code&gt;cd&lt;/code&gt;)
&lt;/h2&gt;

&lt;p&gt;To go back to your home directory from anywhere:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;cd&lt;/code&gt; without any arguments takes you back to your home directory.&lt;/p&gt;

&lt;h1&gt;
  
  
  Practice Mission
&lt;/h1&gt;

&lt;p&gt;Try this short mission to practice what you've learned:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the terminal&lt;/li&gt;
&lt;li&gt;Navigate to your Documents folder&lt;/li&gt;
&lt;li&gt;Create a new folder called "Hobbies"&lt;/li&gt;
&lt;li&gt;Move into the Hobbies folder&lt;/li&gt;
&lt;li&gt;Check your current location&lt;/li&gt;
&lt;li&gt;Move back to the Documents folder&lt;/li&gt;
&lt;li&gt;List the contents to verify your new folder is there&lt;/li&gt;
&lt;li&gt;Return to your home directory&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Remember, every master was once a beginner. Don't be afraid to experiment – that's how you learn and grow your skills!&lt;/p&gt;

&lt;h1&gt;
  
  
  Show Off Your New Terminal Skills!
&lt;/h1&gt;

&lt;p&gt;You've just taken your first steps into a larger world. How about we celebrate this milestone together?&lt;/p&gt;

&lt;p&gt;If you've completed the practice mission (and even if you're still working on it), why not share your progress? It's a great way to track your learning journey and might even inspire others to start their own terminal adventure!&lt;/p&gt;

&lt;p&gt;Here's what you can do:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Take a screenshot of your terminal showing off your new skills&lt;/li&gt;
&lt;li&gt;Post it on Twitter or LinkedIn&lt;/li&gt;
&lt;li&gt;Tag me (&lt;a class="mentioned-user" href="https://dev.to/introvertedbot"&gt;@introvertedbot&lt;/a&gt; on Twitter)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I'll be keeping an eye out to give you a well-deserved shoutout. Plus, who knows? Your post might just encourage another future terminal wizard to take the plunge!&lt;/p&gt;

&lt;p&gt;Remember, every command you type is a step towards mastering the terminal. Let's celebrate each step together!&lt;/p&gt;

&lt;p&gt;In our next lesson, we'll learn how to move your existing files into this new organizational structure we've created. We'll bring order to that digital chaos, all from the command line! Stay tuned, and keep practicing those navigation skills!&lt;/p&gt;

</description>
      <category>linux</category>
      <category>terminal</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
