The Complete Guide to Becoming a Web Developer: Part 6
Tags: webdev, linux, terminal, backend
Published: 2023-08-06 18:28:40

<!-- wp:paragraph -->
<p>Welcome back to the series “Becoming a Web Developer” part 6. If you are new here, you can start with this list&nbsp;[&nbsp;<a href="https://nerdleveltech.com/the-complete-guide-to-becoming-a-web-developer-part-1/" target="_blank" rel="noreferrer noopener">part 1</a>,&nbsp;<a href="https://nerdleveltech.com/the-complete-guide-to-becoming-a-web-developer-part-2/" target="_blank" rel="noreferrer noopener">part 2</a>,&nbsp;<a href="https://nerdleveltech.com/the-complete-guide-to-becoming-a-web-developer-part-3/" target="_blank" rel="noreferrer noopener">part 3</a>,&nbsp;<a href="https://nerdleveltech.com/the-complete-guide-to-becoming-a-web-developer-part-4/" target="_blank" rel="noreferrer noopener">part 4</a>, <a href="https://nerdleveltech.com/the-complete-guide-to-becoming-a-web-developer-part-5/" target="_blank" rel="noreferrer noopener nofollow">part 5</a>]. In this part, we will discuss the terminal and most used commands for web developers, and for more commands and details you can <a href="https://nerdleveltech.com/category/devops/" target="_blank" rel="noreferrer noopener nofollow">visit here</a>.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Now, If you're a web developer, software engineer, or just a tech enthusiast, you've probably used Linux commands and the terminal. But if you're not, let's get you to learn what are they, and why are they so important. Let's dive in!</p>
<!-- /wp:paragraph -->

<!-- wp:spacer -->
<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

<!-- wp:rank-math/toc-block {"headings":[{"key":"be5421df-9148-4be8-bb2d-5eebcd1f3a68","content":"Backend? 🧐","level":2,"link":"#backend-🧐","disable":false,"isUpdated":false,"isGeneratedLink":true},{"key":"22c67621-743e-4381-987c-9d316dcf6e7d","content":"What exactly is the backend?","level":3,"link":"#what-exactly-is-the-backend","disable":false,"isUpdated":false,"isGeneratedLink":true},{"key":"1c6091f9-8a39-4a87-b590-10ff7ae0ac3c","content":"Tips to Get comfortable with the Terminal","level":2,"link":"#tips-to-get-comfortable-with-the-terminal","disable":false,"isUpdated":false,"isGeneratedLink":true},{"key":"acaa963c-0a0a-4642-a576-778770bc1dda","content":"Listing and Path","level":2,"link":"#listing-and-path","disable":false,"isUpdated":false,"isGeneratedLink":true},{"key":"12cb4cc7-54d4-4ace-aff0-6f9ee0955553","content":"The ls Command","level":3,"link":"#the-ls-command","disable":false,"isUpdated":false,"isGeneratedLink":true},{"key":"61a51cdc-2447-4daf-8560-81323030bca3","content":"The pwd Command","level":3,"link":"#the-pwd-command","disable":false,"isUpdated":false,"isGeneratedLink":true},{"key":"39cdaa2a-ab96-41e4-bab8-c0422725e9cb","content":"Navigation and Paths","level":2,"link":"#navigation-and-paths","disable":false,"isUpdated":false,"isGeneratedLink":true},{"key":"339f6c42-b082-4679-8629-49894726a8d5","content":"The cd command","level":3,"link":"#the-cd-command","disable":false,"isUpdated":false,"isGeneratedLink":true},{"key":"c688b77f-9760-475c-85f3-599abb201829","content":"Relative Paths","level":3,"link":"#relative-paths","disable":false,"isUpdated":false,"isGeneratedLink":true},{"key":"9a163d92-d519-4d12-9349-17cd37836e8e","content":"Absolute Paths","level":3,"link":"#absolute-paths","disable":false,"isUpdated":false,"isGeneratedLink":true},{"key":"235f73ca-ba7f-4758-8218-8be352703dbe","content":"Creating Directories (Folders)","level":2,"link":"#creating-directories-folders","disable":false,"isUpdated":false,"isGeneratedLink":true},{"key":"00aa55d2-3189-4cc6-a18c-b00c83e9bec5","content":"The touch Command","level":2,"link":"#the-touch-command","disable":false,"isUpdated":false,"isGeneratedLink":true},{"key":"baee9e9d-bdd6-4d7b-ba29-4cfbf903c307","content":"Removing Files \u0026 Folders","level":3,"link":"#removing-files-folders","disable":false,"isUpdated":false,"isGeneratedLink":true},{"key":"d8acdd31-9a3c-40ae-96eb-f06b0447de53","content":"More Tips and Best Practices","level":2,"link":"#more-tips-and-best-practices","disable":false,"isUpdated":false,"isGeneratedLink":true},{"key":"fa50d937-db83-4a1e-8014-81ba03987443","content":"Common Mistakes and How to Avoid Them","level":3,"link":"#common-mistakes-and-how-to-avoid-them","disable":false,"isUpdated":false,"isGeneratedLink":true},{"key":"a5ea627d-682a-4019-bfa3-34b394f06411","content":"Conclusion","level":2,"link":"#conclusion","disable":false,"isUpdated":false,"isGeneratedLink":true},{"key":"1c028545-4712-4b0c-842f-88a17c3beec0","content":"Additional Resources","level":3,"link":"#additional-resources","disable":false,"isUpdated":false,"isGeneratedLink":true}],"listStyle":"ul"} -->
<div class="wp-block-rank-math-toc-block" id="rank-math-toc"><nav><ul><li class=""><a href="#backend-🧐">Backend? 🧐</a><ul><li class=""><a href="#what-exactly-is-the-backend">What exactly is the backend?</a></li></ul></li><li class=""><a href="#tips-to-get-comfortable-with-the-terminal">Tips to Get comfortable with the Terminal</a></li><li class=""><a href="#listing-and-path">Listing and Path</a><ul><li class=""><a href="#the-ls-command">The ls Command</a></li><li class=""><a href="#the-pwd-command">The pwd Command</a></li></ul></li><li class=""><a href="#navigation-and-paths">Navigation and Paths</a><ul><li class=""><a href="#the-cd-command">The cd command</a></li><li class=""><a href="#relative-paths">Relative Paths</a></li><li class=""><a href="#absolute-paths">Absolute Paths</a></li></ul></li><li class=""><a href="#creating-directories-folders">Creating Directories (Folders)</a></li><li class=""><a href="#the-touch-command">The touch Command</a><ul><li class=""><a href="#removing-files-folders">Removing Files &amp; Folders</a></li></ul></li><li class=""><a href="#more-tips-and-best-practices">More Tips and Best Practices</a><ul><li class=""><a href="#common-mistakes-and-how-to-avoid-them">Common Mistakes and How to Avoid Them</a></li></ul></li><li class=""><a href="#conclusion">Conclusion</a><ul><li class=""><a href="#additional-resources">Additional Resources</a></li></ul></li></ul></nav></div>
<!-- /wp:rank-math/toc-block -->

<!-- wp:spacer -->
<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

<!-- wp:paragraph -->
<p>The terminal, also known as the command line interface (CLI), is a tool that allows us to interact with our computer using text-based commands. It's a powerful tool that gives us direct access to the operating system and allows us to perform tasks more efficiently than we could with a graphical user interface (GUI).</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Linux commands are the language we use to communicate with the terminal. This originated in the Unix operating system but is now used in many other systems, including Linux and MacOS.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>So why should you, as a web developer or software engineer, care about <a href="https://nerdleveltech.com/essential-linux-commands-every-devops-engineer-should-know-part2/" target="_blank" rel="noreferrer noopener nofollow">Linux commands</a> and the terminal? Here are a few reasons:</p>
<!-- /wp:paragraph -->

<!-- wp:list {"ordered":true} -->
<ol><!-- wp:list-item -->
<li><strong>Efficiency</strong>: Linux commands can perform complex tasks quickly and with fewer steps than a GUI.</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li><strong>Control</strong>: The terminal gives you more control over your system. You can access and modify files that are not visible or accessible in a GUI.</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li><strong>Scripting</strong>: Linux commands can be combined into scripts, allowing you to automate repetitive tasks.</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li><strong>Development Tools</strong>: Many tools for developers, like Git and Node.js, are primarily used through the terminal.</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li><strong>Troubleshooting</strong>: Understanding Linux commands can help you diagnose and fix problems on your system.</li>
<!-- /wp:list-item --></ol>
<!-- /wp:list -->

<!-- wp:paragraph -->
<p>In this article, we'll start with the basics and what you need to learn to start with <a href="https://nerdleveltech.com/essential-linux-commands-every-devops-engineer-should-know-part-1/" target="_blank" rel="noreferrer noopener nofollow">Linux</a> as a software developer or web developer.</p>
<!-- /wp:paragraph -->

<!-- wp:spacer -->
<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

<!-- wp:heading -->
<h2 class="wp-block-heading" id="backend-🧐">Backend? 🧐</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Before we dive into the commands and the terminal, let's take a moment to understand what's happening on the backend side of things. If you're new to web development, you might be wondering, </p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading" id="what-exactly-is-the-backend">What exactly is the backend?</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>In the context of web development, the 'backend' refers to the server side of an application. This is the part of the software that users don't see. It's where the magic happens: data is processed, stored, and sent back to the user. The backend is responsible for business logic, database interactions, server configuration, and much more.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Imagine you're visiting an online store. The beautiful webpage you see, with all its images, buttons, and menus, is the 'front end.' It's what you interact with. But when you click on a product to view more details or place an order, your request is sent to the 'backend.' The backend retrieves the product details from the database or processes your order, then sends the information back to the frontend to be displayed to you.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>So, why is understanding the backend important for learning Linux commands and the terminal? Well, as a backend developer, or even a full-stack developer (someone who works on both the frontend and backend), you'll often find yourself working in a Unix-like environment. You'll need to navigate through your system's directories, manipulate files, install software, and run scripts, all using the terminal. That's why getting comfortable with Linux commands is such a crucial skill.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>In the following sections, we'll start exploring these commands, So, buckle up and get ready for an exciting journey!</p>
<!-- /wp:paragraph -->

<!-- wp:spacer -->
<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

<!-- wp:heading -->
<h2 class="wp-block-heading" id="tips-to-get-comfortable-with-the-terminal">Tips to Get comfortable with the Terminal</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Getting comfortable with the terminal is a bit like learning to ride a bike. It might seem intimidating at first, but with practice, it becomes second nature. Here are some tips and strategies to help you become more comfortable with the terminal:</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><strong>1. Practice Regularly</strong></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>The best way to get comfortable with the terminal is to use it regularly. Try to incorporate it into your daily workflow. Need to create a new directory? Use <code>mkdir</code>. Need to move a file? Use <code>mv</code>. The more you use the terminal, the more familiar it will become.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><strong>2. Learn the Basics</strong></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Start with the basic commands like <code>ls</code>, <code>pwd</code>, <code>cd</code>, <code>mkdir</code>, <code>touch</code>, <code>rm</code>, and <code>cp</code>. Understand what they do and practice using them. Once you're comfortable with the basics, you can move on to more advanced commands and concepts.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><strong>3. Use the <code>man</code> Command</strong></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>The <code>man</code> command is your built-in manual. Use it to learn about other commands and their options. For example, <code>man ls</code> will show you the manual for the <code>ls</code> command, including a description of what it does and a list of its options.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><strong>4. Don't Be Afraid to Make Mistakes</strong></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>It's okay to make mistakes. In fact, making mistakes is a great way to learn. If you type a command and it doesn't work, try to figure out why. Is there a typo in the command? Are you in the right directory? Did you forget an option?</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><strong>5. Customize Your Terminal</strong></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Customizing your terminal can make it more pleasant to use. You can change the colors, prompt, and even add features like auto-completion and command aliases. There are also different terminal emulators you can try, each with their own set of features.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><strong>6. Learn to Use a Text Editor</strong></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Knowing how to use a text editor from the terminal is a valuable skill. Whether it's Vim, Emacs, or Nano, choose one and learn the basics. You'll need this skill for editing configuration files, writing scripts, and more.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><strong>7. Explore and Have Fun</strong></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Finally, don't forget to have fun. A terminal is a powerful tool, and learning to use it effectively can open up new possibilities. Try new commands, write scripts, and automate tasks. The more you explore, the more comfortable you'll become.</p>
<!-- /wp:paragraph -->

<!-- wp:spacer -->
<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

<!-- wp:heading -->
<h2 class="wp-block-heading" id="listing-and-path">Listing and Path</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Let's kick things off with two of the most basic yet essential Linux commands: <code>ls</code> and <code>pwd</code>. These commands are your bread and butter when it comes to navigating the terminal. They're the equivalent of looking around and checking your map in a new city.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading" id="the-ls-command">The <code>ls</code> Command</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>The <code>ls</code> command stands for 'list'. As the name suggests, it lists the contents of a directory. When you type <code>ls</code> into the terminal and hit enter, it will display all the files and directories in your current location.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Here's an example:</p>
<!-- /wp:paragraph -->

<!-- wp:prismatic/blocks {"className":"prism-editor no-trans"} -->
<pre class="wp-block-prismatic-blocks prism-editor no-trans"><code class="language-">$ ls
Desktop    Downloads  Pictures  Documents  Music
</code></pre>
<!-- /wp:prismatic/blocks -->

<!-- wp:paragraph -->
<p>This example, <code>ls</code> has listed five directories: Desktop, Downloads, Pictures, Documents, and Music.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>As mentioned, <code>ls</code> lists the contents of a directory. But it can do much more when used with options. Let's look at some examples:</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><code>ls -l</code>: This option displays the contents in a 'long format', which includes additional information such as the file permissions, number of links, owner, group, size, and time of last modification.</p>
<!-- /wp:paragraph -->

<!-- wp:prismatic/blocks {"className":"prism-editor no-trans"} -->
<pre class="wp-block-prismatic-blocks prism-editor no-trans"><code class="language-">$ ls -l
total 0
drwx------+ 3 YourUsername  staff   96 Mar  1 09:00 Desktop
drwx------+ 4 YourUsername  staff  128 Mar  1 09:00 Documents
drwx------+ 3 YourUsername  staff   96 Mar  1 09:00 Downloads
drwx------+ 3 YourUsername  staff   96 Mar  1 09:00 Music
drwx------+ 3 YourUsername  staff   96 Mar  1 09:00 Pictures
</code></pre>
<!-- /wp:prismatic/blocks -->

<!-- wp:paragraph -->
<p><code>ls -a</code>: This option shows all files, including hidden ones. In Unix-like systems, files that start with a dot (.) are hidden.</p>
<!-- /wp:paragraph -->

<!-- wp:prismatic/blocks {"className":"prism-editor no-trans"} -->
<pre class="wp-block-prismatic-blocks prism-editor no-trans"><code class="language-">$ ls -a
.  ..  .bash_history  .bash_profile  Desktop  Documents  Downloads  Music  Pictures
</code></pre>
<!-- /wp:prismatic/blocks -->

<!-- wp:paragraph -->
<p><code>ls -R</code>: This option lists the contents of directories recursively, meaning it will show the contents of the directories within the current directory, and so on.</p>
<!-- /wp:paragraph -->

<!-- wp:prismatic/blocks {"className":"prism-editor no-trans"} -->
<pre class="wp-block-prismatic-blocks prism-editor no-trans"><code class="language-">$ ls -R
.:
Desktop  Documents  Downloads  Music  Pictures

./Desktop:
file1.txt  file2.txt

./Documents:
doc1.docx  doc2.docx

./Downloads:
image1.jpg  image2.jpg

./Music:
song1.mp3  song2.mp3

./Pictures:
photo1.png  photo2.png
</code></pre>
<!-- /wp:prismatic/blocks -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading" id="the-pwd-command">The <code>pwd</code> Command</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>The <code>pwd</code> command stands for 'print working directory'. It tells you where you currently are in your system's directory structure. Think of it as checking your current location on a map.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Here's an example:</p>
<!-- /wp:paragraph -->

<!-- wp:prismatic/blocks {"className":"prism-editor no-trans"} -->
<pre class="wp-block-prismatic-blocks prism-editor no-trans"><code class="language-">$ pwd
/Users/YourUsername
</code></pre>
<!-- /wp:prismatic/blocks -->

<!-- wp:paragraph -->
<p>In this example, <code>pwd</code> has printed the path to the current directory, which is the user's home directory.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><code>pwd -P</code>: This option prints the physical directory, without any symbolic links. If you're in a directory that is a symbolic link (a file that points to another file or directory), <code>pwd -P</code> will show the actual directory, not the linked one.</p>
<!-- /wp:paragraph -->

<!-- wp:prismatic/blocks {"className":"prism-editor no-trans"} -->
<pre class="wp-block-prismatic-blocks prism-editor no-trans"><code class="language-">$ pwd -P
/Users/YourUsername/ActualDirectory
</code></pre>
<!-- /wp:prismatic/blocks -->

<!-- wp:paragraph -->
<p>In this example, even if you navigated to the directory using a symbolic link, <code>pwd -P</code> shows the path to the actual directory.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>These two commands, <code>ls</code> and <code>pwd</code>, are your starting point for navigating the terminal. Practice using them until you're comfortable. In the next sections, we'll learn how to move around the directory structure and manipulate files. So, stay tuned!"</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><strong>P.S.</strong> Remember, you can always use the <code>man</code> command to read the manual and learn more about these commands and their options. For example, <code>man ls</code> will show the manual for the <code>ls</code> command.</p>
<!-- /wp:paragraph -->

<!-- wp:spacer -->
<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

<!-- wp:heading -->
<h2 class="wp-block-heading" id="navigation-and-paths">Navigation and Paths</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Changing directories is a fundamental task you'll do in the terminal. It's like navigating through folders in a graphical file explorer, but instead, you're using text commands. The command to change directories in Unix-based systems is <code>cd</code>, which stands for "change directory".</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Let's start with the basics. If you want to move into a directory, you type <code>cd</code> followed by the name of the directory. For example, if you have a directory named <code>projects</code>, you can move into it with:</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading" id="the-cd-command">The <code>cd</code> command</h3>
<!-- /wp:heading -->

<!-- wp:prismatic/blocks {"className":"prism-editor no-trans"} -->
<pre class="wp-block-prismatic-blocks prism-editor no-trans"><code class="language-">cd projects</code></pre>
<!-- /wp:prismatic/blocks -->

<!-- wp:paragraph -->
<p>Now, what if you want to move back to the previous directory? You can use <code>..</code> to represent the parent directory. So to move back, you can do:</p>
<!-- /wp:paragraph -->

<!-- wp:prismatic/blocks {"className":"prism-editor no-trans"} -->
<pre class="wp-block-prismatic-blocks prism-editor no-trans"><code class="language-">cd ..
</code></pre>
<!-- /wp:prismatic/blocks -->

<!-- wp:paragraph -->
<p>You can also use <code>..</code> to move multiple levels up. For example, <code>cd ../..</code> will move two levels up.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>If you want to go to your home directory, you can use the <code>cd</code> command without any arguments:</p>
<!-- /wp:paragraph -->

<!-- wp:prismatic/blocks {"className":"prism-editor no-trans"} -->
<pre class="wp-block-prismatic-blocks prism-editor no-trans"><code class="language-">cd</code></pre>
<!-- /wp:prismatic/blocks -->

<!-- wp:paragraph -->
<p>You can also use <code>~</code> to represent your home directory. So <code>cd ~</code> will also take you home.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>What about if you want to go to a specific directory, no matter where you currently are? You can do this by providing the absolute path to the directory. For example:</p>
<!-- /wp:paragraph -->

<!-- wp:prismatic/blocks {"className":"prism-editor no-trans"} -->
<pre class="wp-block-prismatic-blocks prism-editor no-trans"><code class="language-">cd /usr/local/bin
</code></pre>
<!-- /wp:prismatic/blocks -->

<!-- wp:paragraph -->
<p>This will take you to the directory <code>/usr/local/bin</code>, regardless of your current directory.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Remember, the terminal is case-sensitive. So <code>cd projects</code> is different from <code>cd Projects</code>.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Also, if the directory name has spaces, you need to enclose it in quotes. For example:</p>
<!-- /wp:paragraph -->

<!-- wp:prismatic/blocks {"className":"prism-editor no-trans"} -->
<pre class="wp-block-prismatic-blocks prism-editor no-trans"><code class="language-">cd "My Projects"
</code></pre>
<!-- /wp:prismatic/blocks -->

<!-- wp:paragraph -->
<p>Or you can escape the space with a backslash:</p>
<!-- /wp:paragraph -->

<!-- wp:prismatic/blocks {"className":"prism-editor no-trans"} -->
<pre class="wp-block-prismatic-blocks prism-editor no-trans"><code class="language-">cd My\ Projects
</code></pre>
<!-- /wp:prismatic/blocks -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading" id="relative-paths">Relative Paths</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>A relative path is a path that starts from your current directory. It's 'relative' to where you are right now in the file system. For example, if you're in a directory called <code>projects</code> and there's a subdirectory in it called <code>myapp</code>, the relative path to <code>myapp</code> is simply:</p>
<!-- /wp:paragraph -->

<!-- wp:prismatic/blocks {"className":"prism-editor no-trans"} -->
<pre class="wp-block-prismatic-blocks prism-editor no-trans"><code class="language-">myapp
cd myapp
cd ..
</code></pre>
<!-- /wp:prismatic/blocks -->

<!-- wp:paragraph -->
<p>You can use this relative path with commands like <code>cd</code> to move into <code>myapp</code>.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Relative paths can also use special directory names like <code>.</code> (which represents the current directory) and <code>..</code> (which represents the parent directory).</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading" id="absolute-paths">Absolute Paths</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>An absolute path, on the other hand, is a path that starts from the root of the file system. It's 'absolute' because it points to the same location, no matter where you currently are in the file system. An absolute path always starts with a <code>/</code>.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>For example, the absolute path to a directory <code>myapp</code> located directly under <code>projects</code> in your home directory might look something like the following. You also can use this absolute path with <code>cd</code> to go directly to <code>myapp</code>, no matter your current location:</p>
<!-- /wp:paragraph -->

<!-- wp:prismatic/blocks {"className":"prism-editor no-trans"} -->
<pre class="wp-block-prismatic-blocks prism-editor no-trans"><code class="language-">/home/username/projects/myapp
cd /home/username/projects/myapp</code></pre>
<!-- /wp:prismatic/blocks -->

<!-- wp:paragraph -->
<p><strong>P.S.</strong> If you're moving around directories close to your current location, relative paths are simpler. If you're jumping to a directory far from your current location, absolute paths can be more direct.</p>
<!-- /wp:paragraph -->

<!-- wp:spacer -->
<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

<!-- wp:heading -->
<h2 class="wp-block-heading" id="creating-directories-folders">Creating Directories (Folders)</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Creating new directories (or folders) is a common task when organizing your files or setting up new projects. In the terminal, you can create directories using the <code>mkdir</code> command, which stands for 'make directory'.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>The basic usage of <code>mkdir</code> is straightforward. Just type <code>mkdir</code> followed by the name of the directory you want to create. For example, to create a directory named <code>myproject</code>, you would use:</p>
<!-- /wp:paragraph -->

<!-- wp:prismatic/blocks {"className":"prism-editor no-trans"} -->
<pre class="wp-block-prismatic-blocks prism-editor no-trans"><code class="language-">mkdir myproject</code></pre>
<!-- /wp:prismatic/blocks -->

<!-- wp:paragraph -->
<p>This will create a new directory named <code>myproject</code> in your current directory. You can verify that the directory was created using the <code>ls</code> command:</p>
<!-- /wp:paragraph -->

<!-- wp:prismatic/blocks {"className":"prism-editor no-trans"} -->
<pre class="wp-block-prismatic-blocks prism-editor no-trans"><code class="language-">ls</code></pre>
<!-- /wp:prismatic/blocks -->

<!-- wp:paragraph -->
<p>If <code>myproject</code> was created successfully, you should see it listed in the output of <code>ls</code>.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>You can also create a directory in a different location by specifying a path. For example, to create a directory named <code>myproject</code> in the <code>projects</code> directory, you would use:</p>
<!-- /wp:paragraph -->

<!-- wp:prismatic/blocks {"className":"prism-editor no-trans"} -->
<pre class="wp-block-prismatic-blocks prism-editor no-trans"><code class="language-">mkdir projects/myproject
</code></pre>
<!-- /wp:prismatic/blocks -->

<!-- wp:paragraph -->
<p>This assumes that the <code>projects</code> directory already exists. If it doesn't, <code>mkdir</code> will give an error. However, you can tell <code>mkdir</code> to create any necessary parent directories by using the <code>-p</code> option:</p>
<!-- /wp:paragraph -->

<!-- wp:prismatic/blocks {"className":"prism-editor no-trans"} -->
<pre class="wp-block-prismatic-blocks prism-editor no-trans"><code class="language-">mkdir -p projects/myproject
</code></pre>
<!-- /wp:prismatic/blocks -->

<!-- wp:paragraph -->
<p>This will create both <code>projects</code> and <code>myproject</code> if they don't already exist.</p>
<!-- /wp:paragraph -->

<!-- wp:spacer -->
<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

<!-- wp:heading -->
<h2 class="wp-block-heading" id="the-touch-command">The <code>touch</code> Command</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>The <code>touch</code> command is a standard command used in UNIX/Linux operating system which is used to create, change and modify timestamps of a file.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Let's say you want to create a new file named 'example.txt'. You can do this using the <code>touch</code> command like so:</p>
<!-- /wp:paragraph -->

<!-- wp:prismatic/blocks {"className":"prism-editor no-trans"} -->
<pre class="wp-block-prismatic-blocks prism-editor no-trans"><code class="language-">touch example.txt
</code></pre>
<!-- /wp:prismatic/blocks -->

<!-- wp:paragraph -->
<p>If the file 'example.txt' does not already exist, the <code>touch</code> command will create a new file with this name. If the file already exists, <code>touch</code> will update the last-modified time of the file.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading" id="removing-files-folders">Removing Files &amp; Folders</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>The <code>rm</code> and <code>rmdir</code> commands are used to remove files and directories respectively.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>The <code>rm</code> command removes specified files. For example, to remove a file named 'example.txt', you would use the <code>rm</code> command like this:</p>
<!-- /wp:paragraph -->

<!-- wp:prismatic/blocks {"className":"prism-editor no-trans"} -->
<pre class="wp-block-prismatic-blocks prism-editor no-trans"><code class="language-">rm example.txt
</code></pre>
<!-- /wp:prismatic/blocks -->

<!-- wp:paragraph -->
<p>Be careful when using <code>rm</code>, as it deletes files permanently. It's not like moving a file to the trash bin, it's more like shredding that file!</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>The <code>rmdir</code> command removes empty directories. To remove a directory, it must be empty of files and other directories. Here's how you would remove a directory named 'example_directory':</p>
<!-- /wp:paragraph -->

<!-- wp:prismatic/blocks {"className":"prism-editor no-trans"} -->
<pre class="wp-block-prismatic-blocks prism-editor no-trans"><code class="language-">rmdir example_directory</code></pre>
<!-- /wp:prismatic/blocks -->

<!-- wp:paragraph -->
<p>If you want to remove a directory and its contents, you can use the <code>rm</code> command with the <code>-r</code> (or <code>--recursive</code>) flag. This tells <code>rm</code> to remove the directory and its contents recursively. Be very careful when using this command, as it will permanently delete the directory and everything within it:</p>
<!-- /wp:paragraph -->

<!-- wp:prismatic/blocks {"className":"prism-editor no-trans"} -->
<pre class="wp-block-prismatic-blocks prism-editor no-trans"><code class="language-">rm -r example_directory
</code></pre>
<!-- /wp:prismatic/blocks -->

<!-- wp:paragraph -->
<p>In summary, <code>touch</code> is used to create or update files, <code>rm</code> is used to remove files and directories, and <code>rmdir</code> is used to remove empty directories.</p>
<!-- /wp:paragraph -->

<!-- wp:spacer -->
<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

<!-- wp:heading -->
<h2 class="wp-block-heading" id="more-tips-and-best-practices">More Tips and Best Practices</h2>
<!-- /wp:heading -->

<!-- wp:list {"ordered":true} -->
<ol><!-- wp:list-item -->
<li><strong>Master the basics</strong>: Start with the basic commands like <code>ls</code>, <code>cd</code>, <code>pwd</code>, <code>touch</code>, <code>rm</code>, and <code>mkdir</code>. Once you're comfortable with these, you can start learning more advanced commands.</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li><strong>Use Tab Completion</strong>: This is a handy feature that allows you to auto-complete file and directory names. Simply start typing the name and then press Tab to auto-complete it.</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li><strong>Learn to use the man pages</strong>: The <code>man</code> command followed by any other Linux command will display the manual page for that command. This is a great way to learn what a command does and how to use it.</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li><strong>Use the history command</strong>: The <code>history</code> command will show you the last commands you've used. This can be very helpful if you need to repeat a command or can't remember a command you used previously.</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li><strong>Learn to use pipes and redirection</strong>: Pipes (<code>|</code>) and redirection (<code>&gt;</code>, <code>&gt;&gt;</code>, <code>&lt;</code>) are powerful features that allow you to chain commands together or redirect input and output.</li>
<!-- /wp:list-item --></ol>
<!-- /wp:list -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading" id="common-mistakes-and-how-to-avoid-them">Common Mistakes and How to Avoid Them</h3>
<!-- /wp:heading -->

<!-- wp:list {"ordered":true} -->
<ol><!-- wp:list-item -->
<li><strong>Deleting the wrong file</strong>: Always double-check the file name before running a <code>rm</code> command. You might also want to use the <code>-i</code> (interactive) option with <code>rm</code> to confirm before deleting.</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li><strong>Using wildcards carelessly</strong>: Wildcards like <code>*</code> can be very useful, but they can also be dangerous if used carelessly. For example, <code>rm *</code> will delete all files in the current directory!</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li><strong>Not understanding command options</strong>: Before using an option (like <code>-r</code> with <code>rm</code>), make sure you understand what it does. The man pages are a great resource for this.</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li><strong>Overusing sudo</strong>: The <code>sudo</code> command gives you superuser privileges, which means you can do things that regular users can't, like deleting system files. Use <code>sudo</code> sparingly and only when necessary.</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li><strong>Not backing up data</strong>: Always back up important data. While Linux commands can be powerful, they can also be destructive if used incorrectly.</li>
<!-- /wp:list-item --></ol>
<!-- /wp:list -->

<!-- wp:spacer -->
<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

<!-- wp:heading -->
<h2 class="wp-block-heading" id="conclusion">Conclusion</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>We've taken quite a journey through the world of Linux commands and the terminal. We started with the basics, learning about commands like <code>ls</code> and <code>pwd</code>, and then moved on to making directories, removing files, and understanding man pages and flags. We've also discussed some common mistakes and best practices to keep in mind when working with the terminal.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Remember, don't be discouraged if you don't remember all the commands or concepts right away. Keep practicing, keep experimenting, and before you know it, you'll be wielding the terminal like a pro.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading" id="additional-resources">Additional Resources</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>For those of you who are eager to continue your journey with Linux commands and the terminal, here are some additional resources that you might find helpful:</p>
<!-- /wp:paragraph -->

<!-- wp:list {"ordered":true} -->
<ol><!-- wp:list-item -->
<li><a href="https://swcarpentry.github.io/shell-novice/" target="_blank" rel="noreferrer noopener nofollow">The Unix Shell</a>: A great tutorial for beginners from Software Carpentry.</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li><a href="https://www.udacity.com/course/linux-command-line-basics--ud595" target="_blank" rel="noreferrer noopener nofollow">Linux Command Line Basics</a>: A free course from Udacity that covers the basics of the Linux command line.</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li><a href="https://tldp.org/LDP/abs/html/" target="_blank" rel="noreferrer noopener nofollow">Advanced Bash-Scripting Guide</a>: For those interested in scripting, this guide is a comprehensive resource.</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li><a href="https://explainshell.com/" target="_blank" rel="noreferrer noopener nofollow">Explain Shell</a>: A handy tool that explains what each part of a Unix command does.</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li><a href="https://www.mankier.com/" target="_blank" rel="noreferrer noopener nofollow">ManKier</a>: Another great tool for understanding Unix commands. It provides explanations for commands and their options.</li>
<!-- /wp:list-item --></ol>
<!-- /wp:list -->