<?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: mikel brierly</title>
    <description>The latest articles on DEV Community by mikel brierly (@mikel_brierly).</description>
    <link>https://dev.to/mikel_brierly</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%2F419822%2F1205a84d-d267-4f11-a952-88481765e1cf.png</url>
      <title>DEV Community: mikel brierly</title>
      <link>https://dev.to/mikel_brierly</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mikel_brierly"/>
    <language>en</language>
    <item>
      <title>Introduction to the command line</title>
      <dc:creator>mikel brierly</dc:creator>
      <pubDate>Mon, 30 Nov 2020 17:55:41 +0000</pubDate>
      <link>https://dev.to/mikel_brierly/introduction-to-the-command-line-4ge1</link>
      <guid>https://dev.to/mikel_brierly/introduction-to-the-command-line-4ge1</guid>
      <description>&lt;h3&gt;
  
  
  This guide will go through what the the command line interface (&lt;code&gt;CLI&lt;/code&gt;) is, why we need it, and how to start using it!
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;NOTE: All the examples here are for Mac/Linux users. If you are on Windows 10 or newer, you can use the &lt;a href="https://docs.microsoft.com/en-us/windows/wsl/install-win10" rel="noopener noreferrer"&gt;Windows Subsystem for Linux&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;You'll often hear the &lt;code&gt;command line&lt;/code&gt; referred to in different ways:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;terminal&lt;/code&gt;&lt;br&gt;
&lt;code&gt;CLI&lt;/code&gt;&lt;br&gt;
&lt;code&gt;command prompt&lt;/code&gt;&lt;br&gt;
&lt;code&gt;shell&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Here we'll refer to it as the &lt;code&gt;terminal&lt;/code&gt; and &lt;code&gt;CLI&lt;/code&gt; (command line interface).&lt;/p&gt;


&lt;h2&gt;
  
  
  A Little Background
&lt;/h2&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%2Fi.stack.imgur.com%2FvoqT3.jpg" 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%2Fi.stack.imgur.com%2FvoqT3.jpg" alt="An image of an old punch card machine"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Before the introduction of the graphical user interface (screens with a mouse pointer), the only way to interact with your computer was through the &lt;code&gt;terminal&lt;/code&gt;. &lt;a href="https://en.wikipedia.org/wiki/Punched_card" rel="noopener noreferrer"&gt;The earliest terminals&lt;/a&gt; (dating back to the mid 1960's) literally punched out the user's program (hand-written and then transcribed) onto to a card. The terminal has evolved exponentially since then, but it is still text-based, and it is still the most efficient way to communicate with our machines.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;&lt;a href="https://softwareengineering.stackexchange.com/questions/262723/why-were-punch-cards-used-for-programming" rel="noopener noreferrer"&gt;Here is a really good thread&lt;/a&gt; talking about why punched cards were used for early computing&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;


&lt;h2&gt;
  
  
  CLI Basics
&lt;/h2&gt;

&lt;p&gt;Alright, Let's get into it. Go ahead and open the terminal application. (It's included on your operating system)&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%2Fi.imgur.com%2FU3CIEw1.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%2Fi.imgur.com%2FU3CIEw1.png" alt="Screenshot of the terminal listing our current location as "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In your terminal, you'll see some information: which user is currently logged in, the name of the computer, and where you are in your computer right now. (there might be some slight variation, and this output is configurable). You should see a little squiggly line toward the end.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;(if you don't see that, type &lt;code&gt;cd&lt;/code&gt; and hit enter)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;That little squiggle is called a &lt;code&gt;tilde&lt;/code&gt;, and it indicates that you are at your home directory (&lt;em&gt;you'll see it on the key above &lt;code&gt;tab&lt;/code&gt; on your keyboard&lt;/em&gt;). &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What's my home directory you say? Lets find out! &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Type &lt;code&gt;ls&lt;/code&gt; and hit enter.&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 command "lists" all the items in your current &lt;code&gt;directory&lt;/code&gt;. (you can think of directories as folders). You should see some directories that look fairly familiar, such as Applications, Desktop, Documents, and Photos. To get into one of these directories, we can use the &lt;code&gt;cd&lt;/code&gt; command.&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; stands for "change directory". Let's get into the "Documents" directory.&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;Notice that our current directory has changed to &lt;code&gt;~/Documents&lt;/code&gt;. &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%2Fi.imgur.com%2FnDeauCk.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%2Fi.imgur.com%2FnDeauCk.png" alt="Screen Shot of the terminal listing our current location as "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's "list" what's inside.&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;Probably some directories (folders), and files, each will be displayed differently. Directories are usually indicated by a color of some sort, and files are usually plain. &lt;/p&gt;

&lt;p&gt;But for now, let's go back to the Desktop directory. To navigate back, type &lt;code&gt;cd ..&lt;/code&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; ..
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;..&lt;/code&gt; indicates going back one directory. &lt;em&gt;A single &lt;code&gt;.&lt;/code&gt; indicates right here where you are&lt;/em&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;.&lt;/span&gt;
&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%2Fi.imgur.com%2FTyf5DEP.jpg" 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%2Fi.imgur.com%2FTyf5DEP.jpg" alt="Luke Skywalker looking at the horizon at dusk of the desert planet Tatooine. Two suns are setting in the desolate landscape"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I like to remember it by the twin suns of Tatooine, a BACKwater planet.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;Make sure you put a space between &lt;code&gt;cd&lt;/code&gt; and &lt;code&gt;..&lt;/code&gt; or the terminal will yell at you. &lt;/p&gt;

&lt;p&gt;Now that took us back to the home directory &lt;code&gt;~&lt;/code&gt;, right where we were before. (if you want to jump to the home directory from any location, just type &lt;code&gt;cd&lt;/code&gt; by itself). &lt;/p&gt;

&lt;p&gt;Now let's make a file of our own! Type &lt;code&gt;touch luke-skywalker.txt&lt;/code&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;touch &lt;/span&gt;luke-skywalker.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;touch&lt;/code&gt; is a command used to create files! You have a lot of power with &lt;code&gt;touch&lt;/code&gt;, because you can add any extension you like to files you create, such power!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;When you are creating your file, make sure that your filename has no spaces in it, as the command line will interpret "luke" and "skywalker" as two separate files to create if there is a space&lt;/em&gt;&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%2Fi.ytimg.com%2Fvi%2FPIGeIdrS-d8%2Fmaxresdefault.jpg" 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%2Fi.ytimg.com%2Fvi%2FPIGeIdrS-d8%2Fmaxresdefault.jpg" alt="Luke Skywalker laying in the snow of Hoth, nearly dead."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I think our file needs a better place to live, rather than exposed out in the hoth-like conditions of the home directory. Let's create a &lt;em&gt;new&lt;/em&gt; directory for our file to live in. Type &lt;code&gt;mkdir tauntaun&lt;/code&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;mkdir &lt;/span&gt;tauntaun
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;mkdir&lt;/code&gt; stands for "make directory". Let's run &lt;code&gt;ls&lt;/code&gt; again to list our new 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%2Fi.imgur.com%2FDs0mKE0.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%2Fi.imgur.com%2FDs0mKE0.png" alt="Screen Shot of terminal after running the "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Luke is looking a little &lt;em&gt;chilly&lt;/em&gt; though, so let's help him out and put him &lt;em&gt;inside&lt;/em&gt; the tauntan.&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%2Fimg.buzzfeed.com%2Fbuzzfeed-static%2Fstatic%2F2017-12%2F8%2F19%2Fasset%2Fbuzzfeed-prod-fastlane-02%2Fanigif_sub-buzz-13450-1512778264-6.gif%3Foutput-quality%3Dauto%26output-format%3Dauto%26downsize%3D360%3A%2A" 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%2Fimg.buzzfeed.com%2Fbuzzfeed-static%2Fstatic%2F2017-12%2F8%2F19%2Fasset%2Fbuzzfeed-prod-fastlane-02%2Fanigif_sub-buzz-13450-1512778264-6.gif%3Foutput-quality%3Dauto%26output-format%3Dauto%26downsize%3D360%3A%2A" alt="Han Solo cutting open a tauntaun with a lightsaber"&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;mv &lt;/span&gt;luke-skywalker.txt tauntaun
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;mv&lt;/code&gt; takes two &lt;code&gt;operands&lt;/code&gt; (parameters), the first one is the item to be moved, and the second is the &lt;code&gt;directory&lt;/code&gt; it is to be moved to.&lt;/p&gt;

&lt;p&gt;Let's run &lt;code&gt;ls&lt;/code&gt; again to see what changed.&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%2Fi.imgur.com%2F6YGsNzk.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%2Fi.imgur.com%2F6YGsNzk.png" alt="Screen Shot of terminal after running the "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;luke-skywalker.txt&lt;/code&gt; is gone, which is expected, but let's check and make sure he's &lt;em&gt;inside&lt;/em&gt; the &lt;code&gt;tauntaun&lt;/code&gt; directory.&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;tauntaun
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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;Now you should see &lt;code&gt;luke-skywalker.txt&lt;/code&gt; inside there!!&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%2F2warpstoneptune.files.wordpress.com%2F2015%2F03%2Fesb-tauntaun-1980-1.jpg" 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%2F2warpstoneptune.files.wordpress.com%2F2015%2F03%2Fesb-tauntaun-1980-1.jpg" alt="Toy figure of tauntaun with luke skywalker inside"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Is there anything else you can think of that Tauntauns are full of? Let's add them in!&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;guts.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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;bad-smells.txt
&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%2Fi.imgur.com%2FtmV5L4P.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%2Fi.imgur.com%2FtmV5L4P.png" alt="Screen Shot of running the command "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;When we run this command, it creates that file &lt;em&gt;inside&lt;/em&gt; the tauntaun directory because our current location &lt;em&gt;is inside of it&lt;/em&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;now when we type &lt;code&gt;ls&lt;/code&gt;, we see that our "tauntaun" directory is full of guts, bad smells, and Luke Skywalker! &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%2Fi.imgur.com%2Fayrzn8x.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%2Fi.imgur.com%2Fayrzn8x.png" alt="Screen Shot of tauntaun directory with the files "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's make a &lt;em&gt;directory&lt;/em&gt; now. We'll call it "stomach".&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;stomach
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now enter that directory with the &lt;code&gt;cd&lt;/code&gt; command&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;stomach
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inside the stomach, let's make another file, this time with a different file extension just to mix it up.&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;hoth-hog.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's run &lt;code&gt;ls&lt;/code&gt; and make sure everything is where we want it to be.&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%2Fi.imgur.com%2Ftogz4nn.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%2Fi.imgur.com%2Ftogz4nn.png" alt="Screen Shot of the file hoth-hog.html inside ~/hoth/tauntaun/stomach"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Looks good!&lt;/p&gt;




&lt;p&gt;At this point, we are &lt;em&gt;inside&lt;/em&gt; the stomach of the tauntaun. but what if we wanted to go back &lt;strong&gt;multiple&lt;/strong&gt; directories?&lt;/p&gt;

&lt;p&gt;We can do that with the by chaining our &lt;code&gt;..&lt;/code&gt; operand. To go back two directories, we would say&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;blockquote&gt;
&lt;p&gt;This will take us out of the &lt;code&gt;stomach&lt;/code&gt; directory, and &lt;em&gt;also&lt;/em&gt; out of the &lt;code&gt;tauntaun&lt;/code&gt; directory. (&lt;em&gt;A single &lt;code&gt;../&lt;/code&gt; would have just taken us out of the &lt;code&gt;stomach&lt;/code&gt; directory.&lt;/em&gt;)&lt;/p&gt;
&lt;/blockquote&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%2F64.media.tumblr.com%2F7d9bdd2d4a983d0fd9e7e7e074d0263f%2Ftumblr_nss88fitrs1s27326o8_r1_250.gif" 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%2F64.media.tumblr.com%2F7d9bdd2d4a983d0fd9e7e7e074d0263f%2Ftumblr_nss88fitrs1s27326o8_r1_250.gif" alt="Han Solo saying "&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Useful CLI commands
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Print working directory (where you currently are)
&lt;/h3&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; allows you to check where you are currently located in your system.&lt;/p&gt;

&lt;p&gt;It stands for "print working directory", and it shows you where you currently are. It will print out the &lt;code&gt;path&lt;/code&gt; of where you are all the way back to the &lt;em&gt;root&lt;/em&gt; directory (&lt;code&gt;/&lt;/code&gt;).&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;~&lt;/code&gt; = &lt;em&gt;home directory&lt;/em&gt;&lt;br&gt;
&lt;code&gt;/&lt;/code&gt; = &lt;em&gt;root directory&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  Print file contents
&lt;/h3&gt;



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

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;cat&lt;/code&gt; shows us the contents of a file right inside the terminal itself. Keep in mind this command is most useful for shorter files that are only a few lines long. (cat stands for concatenate, which means "link (things) together in a chain or series").&lt;/p&gt;

&lt;p&gt;Here's an example of what the &lt;code&gt;cat&lt;/code&gt; command prints out for a small html file.&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%2Fi.imgur.com%2FshjJczG.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%2Fi.imgur.com%2FshjJczG.png" alt="Screenshot of output from cat command, a small html file printed to the terminal after running the "&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Search
&lt;/h3&gt;



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

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;grep&lt;/code&gt; command searches any given input, selecting lines that match, and printing out what did match! Let's look at a simple example:&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="c"&gt;# create sample file:&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"I am a test string I created just now"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; test.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="s2"&gt;"created"&lt;/span&gt; test.txt
&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%2Fi.imgur.com%2FWnBZAxJ.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%2Fi.imgur.com%2FWnBZAxJ.png" alt="Screen Shot of a string saying grep "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;See how grep highlighted our search criteria?&lt;/p&gt;

&lt;p&gt;&lt;code&gt;grep&lt;/code&gt; can also search the output of another command, not just a file! Let's see how it could work with &lt;code&gt;cat&lt;/code&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;cat &lt;/span&gt;test.txt | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="s2"&gt;"created"&lt;/span&gt;
&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%2Fi.imgur.com%2FBMDGYRN.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%2Fi.imgur.com%2FBMDGYRN.png" alt="Screen Shot of the command cat test.txt | grep "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To fully understand how this is working, see &lt;code&gt;pipe&lt;/code&gt; (&lt;code&gt;|&lt;/code&gt;) in the next example and give it a go yourself.&lt;/p&gt;




&lt;h3&gt;
  
  
  Pipe output
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;|
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By using &lt;code&gt;pipe&lt;/code&gt; (&lt;code&gt;|&lt;/code&gt;), you can take the &lt;em&gt;output&lt;/em&gt; of any command, and pass it into another command. &lt;/p&gt;

&lt;p&gt;There are many things this could be used for, but a common one you can focus on now is using it in conjunction with &lt;code&gt;grep&lt;/code&gt; to search for things. If you wanted to search the contents of a file, you could output it's contents using &lt;code&gt;cat&lt;/code&gt;, and then search with &lt;code&gt;grep&lt;/code&gt; using a pipe. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;name-list.txt&lt;/code&gt; is a simple list of names. We can output them using the &lt;code&gt;cat&lt;/code&gt; command&lt;/p&gt;
&lt;/blockquote&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%2Fi.imgur.com%2FHkshsST.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%2Fi.imgur.com%2FHkshsST.png" alt="Screen Shot of a list of names after running the "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now if we take that output and &lt;strong&gt;pipe&lt;/strong&gt; it &lt;em&gt;to&lt;/em&gt; &lt;code&gt;grep&lt;/code&gt;, we can search its output.&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;cat &lt;/span&gt;name-list.txt | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="s2"&gt;"Han Solo"&lt;/span&gt;
&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%2Fi.imgur.com%2F3ofQ1mL.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%2Fi.imgur.com%2F3ofQ1mL.png" alt="Screen Shot of the command cat name-list.txt | grep "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;grep&lt;/code&gt; only gives output if it finds a match for what you passed it! In this case, it gave us the line with our search criteria: &lt;code&gt;Han Solo&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;If we wanted to see lines around our match, we could use a &lt;code&gt;flag&lt;/code&gt; of &lt;code&gt;-C&lt;/code&gt;:&lt;/em&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;cat &lt;/span&gt;name-list.txt | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="s2"&gt;"Ahsoka Tano"&lt;/span&gt; &lt;span class="nt"&gt;-C&lt;/span&gt; 2
&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%2Fi.imgur.com%2F0zv0rAC.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%2Fi.imgur.com%2F0zv0rAC.png" alt="Screen Shot of the use of the -C flag at the end of our grep search to see lines above and below our results."&gt;&lt;/a&gt;&lt;br&gt;
See our highlighted result? But it &lt;strong&gt;also&lt;/strong&gt; gave us 2 lines above and below when we used the &lt;code&gt;-C&lt;/code&gt; flag. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;-C&lt;/code&gt; gives lines before and after match&lt;br&gt;
&lt;code&gt;-B&lt;/code&gt; gives lines before match&lt;br&gt;
&lt;code&gt;-A&lt;/code&gt; gives lines after match&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;Remember that &lt;code&gt;|&lt;/code&gt; can be used with anything that gives output. (&lt;code&gt;grep&lt;/code&gt; is just an example)&lt;/em&gt;&lt;/p&gt;


&lt;h3&gt;
  
  
  File Preview
&lt;/h3&gt;


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

&lt;/div&gt;


&lt;p&gt;Using the &lt;code&gt;head&lt;/code&gt; command on a file will give you only the first few lines of the file. This can be helpful if you need to see a header, license, or just to check the structure of a document.&lt;/p&gt;


&lt;h3&gt;
  
  
  Line Numbers
&lt;/h3&gt;


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

&lt;/div&gt;


&lt;p&gt;If you want to see your output numbered by line, you can use the &lt;code&gt;-n&lt;/code&gt; flag. Any command that gives output can be used with the &lt;code&gt;-n&lt;/code&gt; flag. Here's an example using &lt;code&gt;cat&lt;/code&gt; on our &lt;code&gt;names-list.txt&lt;/code&gt; file.&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%2Fi.imgur.com%2FZ7fRj59.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%2Fi.imgur.com%2FZ7fRj59.png" alt="Screen Shot of file output but with a numbered list on the left-hand side of the results"&gt;&lt;/a&gt;&lt;/p&gt;


&lt;h3&gt;
  
  
  Copy
&lt;/h3&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;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;code&gt;copy&lt;/code&gt; takes two parameters, the first is the file to be copied, and the second is what you want to call the copied file (&lt;em&gt;it can't have the same name as the original&lt;/em&gt;). &lt;/p&gt;

&lt;p&gt;ex: &lt;code&gt;cp file1.txt file1-copy.txt&lt;/code&gt; - this will create a copy of &lt;code&gt;file1.txt&lt;/code&gt; named &lt;code&gt;file1-copy.txt&lt;/code&gt; in the same directory you are currently in.&lt;/p&gt;


&lt;h3&gt;
  
  
  Delete (remove)
&lt;/h3&gt;

&lt;p&gt;For 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;rm&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For directories:&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;rm&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;rm&lt;/code&gt; stands for remove, but the &lt;code&gt;-r&lt;/code&gt; can be a little confusing. The &lt;code&gt;-&lt;/code&gt; indicates a flag, and the &lt;code&gt;r&lt;/code&gt; stands for "recursively". We'll get more into recursion later, but for now, you can think of &lt;code&gt;-r&lt;/code&gt; as a &lt;strong&gt;way to manipulate directories when a command without &lt;code&gt;-r&lt;/code&gt; won't work&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;For example, running &lt;code&gt;rm tauntaun&lt;/code&gt; will tell you &lt;code&gt;rm: tauntaun: is a directory&lt;/code&gt;. So we need to use the &lt;code&gt;-r&lt;/code&gt; &lt;em&gt;flag&lt;/em&gt;. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Quick note on deleting and modifying files: When you give CLI commands, there is usually no confirmation and no "undo's". If we want the command line to be a little more forgiving, we can use the "interactive" flag, "-i".&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  Interactive (confirm commands)
&lt;/h3&gt;



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

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;-i&lt;/code&gt; will make the command line interactively ask us if we want to perform destructive actions.&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;rm&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; hoth-hog.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using the &lt;code&gt;-i&lt;/code&gt; flag will force you to confirm certain actions, and you can simply reply &lt;code&gt;y&lt;/code&gt; or &lt;code&gt;n&lt;/code&gt; to continue or cancel the operation.&lt;/p&gt;




&lt;h3&gt;
  
  
  Manual (help pages)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;man
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;man&lt;/code&gt; stands for manual, and is used in conjunction with other commands. If you want to learn more about any specific command, you can simply type &lt;code&gt;man&lt;/code&gt; before it, and you'll get a very thorough explanation of what it can do. For example, if you wanted to learn more about the &lt;code&gt;mkdir&lt;/code&gt; command, you would type &lt;code&gt;man mkdir&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;To &lt;strong&gt;exit&lt;/strong&gt; the man page, hit &lt;code&gt;q&lt;/code&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  Use your skills!
&lt;/h3&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%2Fthumbs.gfycat.com%2FInsidiousRecentFlies-small.gif" 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%2Fthumbs.gfycat.com%2FInsidiousRecentFlies-small.gif" alt="Darth Vader cutting down rebels with his lightsaber in the hallway of a rebel ship."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Download &lt;a href="https://github.com/mikelbrierly/command-line" rel="noopener noreferrer"&gt;this repo&lt;/a&gt; to your local machine:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click the green &lt;code&gt;code&lt;/code&gt; button at the top of the page&lt;/li&gt;
&lt;/ul&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%2Fi.imgur.com%2F5iEoUgp.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%2Fi.imgur.com%2F5iEoUgp.png" alt="Screen Shot of button saying "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In the dropdown menu that appears, click "Download ZIP", and save the file on your computer. (Somewhere you can conveniently access it.)&lt;/li&gt;
&lt;/ul&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%2Fi.imgur.com%2FwAcWmrB.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%2Fi.imgur.com%2FwAcWmrB.png" alt="Screen Shot of button saying "&gt;&lt;/a&gt;&lt;/p&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Use the terminal to navigate to the newly downloaded &lt;code&gt;directory&lt;/code&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The name of the folder will be &lt;code&gt;command-line-master&lt;/code&gt;. &lt;code&gt;master&lt;/code&gt; just means what &lt;em&gt;branch&lt;/em&gt; of the code you have.&lt;/li&gt;
&lt;/ul&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%2Fi.imgur.com%2FyjlXIej.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%2Fi.imgur.com%2FyjlXIej.png" alt="Screen Shot 2020-11-30 at 8.42.15 AM"&gt;&lt;/a&gt;&lt;/p&gt;


&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;code&gt;cd&lt;/code&gt; into the &lt;code&gt;rebel-traitor-hunt&lt;/code&gt; directory &lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Use the &lt;code&gt;cat&lt;/code&gt; command to read the contents of the file &lt;code&gt;instructions-from-vader&lt;/code&gt; to get started!&lt;/p&gt;&lt;/li&gt;

&lt;/ul&gt;

&lt;h5&gt;
  
  
  Tips:
&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;Keep this webpage open for referencing commands you'll need, and for brushing up on the lesson as you go along.&lt;/li&gt;
&lt;li&gt;For extra help, &lt;a href="https://github.com/mikelbrierly/command-line/blob/master/WALKTHROUGH.md" rel="noopener noreferrer"&gt;open up the walkthrough file&lt;/a&gt;. It has detailed hints, and the commands to run if you still need that extra push.&lt;/li&gt;
&lt;/ul&gt;




&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;If you want to learn more about the command line, or find more commands, MDN has a wealth of information, and goes into a lot of detail explaining what you can accomplish with this tool. &lt;a href="https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Understanding_client-side_tools/Command_line" rel="noopener noreferrer"&gt;For more reading, this is a good starting point.&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>tutorial</category>
      <category>beginners</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>Pixel Perfect</title>
      <dc:creator>mikel brierly</dc:creator>
      <pubDate>Mon, 23 Nov 2020 17:21:39 +0000</pubDate>
      <link>https://dev.to/mikel_brierly/pixel-perfect-48fj</link>
      <guid>https://dev.to/mikel_brierly/pixel-perfect-48fj</guid>
      <description>&lt;p&gt;&lt;em&gt;CSS is a powerful, intricate language that gives the web beauty and life. &lt;strong&gt;But&lt;/strong&gt; it also can make you want to throw your computer out of a four story window and never touch the front-end again.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;Most frustration with CSS comes from a lack of understanding, which makes sense since it is often taught as an afterthought of web development. If CSS was treated like a language rather than a coat of paint, I think we would appreciate its value more.&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%2Fi%2F436vfjfyimyrzgvhcesc.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%2Fi%2F436vfjfyimyrzgvhcesc.png" alt="gold pixel art coins displayed in a row"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All of the CSS we write eventually boils down to pixels displayed on a screen for our users to see and engage with. But the term &lt;code&gt;pixel&lt;/code&gt; can be misleading when we are talking about the values in our stylesheets. It stands to reason that a "pixel" would be the smallest visible quantity that can be displayed on a screen. But in reality, a pixel is just... really small. (1/96 of an inch apparently, but who's counting) &lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.w3.org/TR/css-values-3/#reference-pixel" rel="noopener noreferrer"&gt;Here's what the spec says&lt;/a&gt;: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;The reference pixel is the visual angle of one pixel on a device with a pixel density of 96dpi and a distance from the reader of an arm's length. For a nominal arm's length of 28 inches, the visual angle is therefore about 0.0213 degrees.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&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%2Fi.imgflip.com%2F1j9mu4.jpg" 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%2Fi.imgflip.com%2F1j9mu4.jpg" alt="Woman looking confused as math equations float all around her head"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;I was not enlightened by that explanation, so I took some bigfoot-esque photos of different physical screens displaying a single yellow CSS pixel.&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%2Fi%2F9jvv03o0wg8c4y9rutts.jpg" 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%2Fi%2F9jvv03o0wg8c4y9rutts.jpg" alt="an older LG Monitor, an iPhone 8+, and a 2018 15"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h6&gt;
  
  
  &lt;em&gt;That's an older LG Monitor, an iPhone 8+, and a 2018 15" MacBook pro.&lt;/em&gt;
&lt;/h6&gt;

&lt;p&gt;It looks like our 1 css pixel equated to: 1 screen px for the LG, maybe around 6 or 8 for the iPhone, and 4 screen px for the MacBook. That's just conjecture though, this is the important part:&lt;br&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%2Fi%2Ff0vqz5g06g3198u2oqok.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%2Fi%2Ff0vqz5g06g3198u2oqok.png" alt="An image saying "&gt;&lt;/a&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  So what?
&lt;/h2&gt;

&lt;p&gt;It's important to understand how our tools work, and when it is best to reach for them. &lt;code&gt;px&lt;/code&gt; isn't the only fish in the sea.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The CSS &lt;code&gt;px&lt;/code&gt; value should be used when you need an absolute unit of measurement for an element that will not fluctuate in size on your page. (Or it will change very little)&lt;/p&gt;
&lt;/blockquote&gt;



&lt;p&gt;There are &lt;em&gt;other&lt;/em&gt; units of measurement in CSS that can offer flexibility and responsiveness in ways that &lt;code&gt;px&lt;/code&gt; fails to.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;div {
  height: 10em;
}

div {
  height: 10rem;
}

div {
  height: 10vh;
}

div {
  height: 10%;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;em&lt;/code&gt;: &lt;em&gt;Font size of the parent element&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;rem&lt;/code&gt;: &lt;em&gt;Font size of the root element&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;vh&lt;/code&gt;: &lt;em&gt;1% of the viewport's height&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;%&lt;/code&gt;: &lt;em&gt;Usually a percentage of the nearest "sized" parent element&lt;/em&gt; (There are a lot of caveats to this one)&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%2Fi.imgur.com%2FKu4dKRH.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%2Fi.imgur.com%2FKu4dKRH.png" alt="a gold pixel art crown"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In my personal opinion, if you need a unit of CSS measurement that offers the most flexibility &lt;em&gt;and&lt;/em&gt; control, &lt;code&gt;rem&lt;/code&gt; wins hands down. It is more predictable than &lt;code&gt;em&lt;/code&gt;, and makes responsiveness a breeze when changing layouts or sizes for different screens. I won't get into the weeds here, it was &lt;strong&gt;very&lt;/strong&gt; thoroughly explained in &lt;a href="https://www.sitepoint.com/understanding-and-using-rem-units-in-css/" rel="noopener noreferrer"&gt;this wonderful article&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Hopefully you have a little extra nugget of knowledge when it comes to CSS units of measurement, cheers! 🍻&lt;/p&gt;




&lt;p&gt;Pixel art by &lt;a href="http://clintbellanger.net/" rel="noopener noreferrer"&gt;Clint Bellanger&lt;/a&gt;&lt;/p&gt;

</description>
      <category>css</category>
      <category>webdev</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>Deliver us from dependency hell</title>
      <dc:creator>mikel brierly</dc:creator>
      <pubDate>Fri, 21 Aug 2020 16:06:28 +0000</pubDate>
      <link>https://dev.to/mikel_brierly/deliver-us-from-dependency-hell-g36</link>
      <guid>https://dev.to/mikel_brierly/deliver-us-from-dependency-hell-g36</guid>
      <description>&lt;p&gt;&lt;em&gt;Most modern services and applications have a mass of dependencies that live in an ever-growing &lt;code&gt;node-modules&lt;/code&gt; folder. Generally a lot of these libraries are being actively maintained, changed, and updated. If your dependencies are poorly managed, you can quickly find yourself in dependency hell.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you're unfamiliar with npm, &lt;a href="https://www.npmjs.com/" rel="noopener noreferrer"&gt;check it out here&lt;/a&gt; before reading on&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🛒 Grocery Shopping
&lt;/h2&gt;

&lt;p&gt;When starting up a node application, one of the first steps is running &lt;code&gt;npm install&lt;/code&gt;. When you run this, node will check for a file called &lt;code&gt;package.json&lt;/code&gt; in the base of your project. If that file is found, it will use the &lt;code&gt;dependency&lt;/code&gt; section as a kind of "grocery shopping list" to go and gather "ingredients" (code bits) your application requires. &lt;br&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%2Fi%2Firv5d0ev1hkbfbnpacn8.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%2Fi%2Firv5d0ev1hkbfbnpacn8.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
The "grocery store" in this case is something npm calls a &lt;code&gt;registry&lt;/code&gt;. By default, your node app will look in the public npm registry for these packages, where most everything you need will be (private registries can be created for proprietary code and whatnot). If the package is found in the registry, node puts that "ingredient" into a &lt;code&gt;node_modules&lt;/code&gt; directory at the base of your project.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;It's important to note that packages that you require may have their own "shopping list" (package.json), and all of those nested dependencies must be resolved before your app moves on to the next dependency in its own package.json.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&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%2Fi%2Ffe0h8vkw0jqhmsx8bk6h.gif" 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%2Fi%2Ffe0h8vkw0jqhmsx8bk6h.gif" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  ⬆️ Versions, 🥕 Carets, and 🃏 Wildcards
&lt;/h2&gt;

&lt;p&gt;The versions of your dependencies are generally something like &lt;code&gt;v1.3.5&lt;/code&gt;. This is called &lt;strong&gt;semantic versioning&lt;/strong&gt;, or semver. With semver, the numbers represent changes to the code in varying severity - &lt;code&gt;MAJOR.MINOR.PATCH&lt;/code&gt;.&lt;br&gt;
From their docs -&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;MAJOR version when you make incompatible API changes,&lt;br&gt;
MINOR version when you add functionality in a backwards compatible manner, and&lt;br&gt;
PATCH version when you make backwards compatible bug fixes.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;With this in mind, a lot of people want to automatically update their app with any fresh new stuff their dependencies might have in newer, &lt;em&gt;non-breaking&lt;/em&gt; changes. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Prefixing with tilde &lt;code&gt;~&lt;/code&gt; will give you any new &lt;code&gt;PATCH&lt;/code&gt; updates, but not major or minor. So &lt;code&gt;~1.3.1&lt;/code&gt; could install &lt;code&gt;1.3.9&lt;/code&gt;, but not &lt;code&gt;1.4.0&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Prefixing with caret &lt;code&gt;^&lt;/code&gt; will give you any new &lt;code&gt;PATCH&lt;/code&gt; &lt;em&gt;and&lt;/em&gt; &lt;code&gt;MINOR&lt;/code&gt; versions, but not major. So &lt;code&gt;^1.3.1&lt;/code&gt; could install &lt;code&gt;1.4.9&lt;/code&gt; but not &lt;code&gt;1.5.0&lt;/code&gt;&lt;br&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%2Fi%2Flyfok6d7l3ib2lgi5t7u.gif" 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%2Fi%2Flyfok6d7l3ib2lgi5t7u.gif" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&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%2Fi%2Ffrb2wpeqfv90ch9f6t9l.gif" 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%2Fi%2Ffrb2wpeqfv90ch9f6t9l.gif" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Let's take a look at our example code's dependency tree:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;my-breakfast
     |
     |
    milk
     |
     |
coffee-script  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ok, more like a &lt;em&gt;stick&lt;/em&gt;, but hopefully the chain of dependency is clear. Our package.json is requiring version &lt;code&gt;v0.5.0&lt;/code&gt; &lt;em&gt;specifically&lt;/em&gt; of &lt;code&gt;milk&lt;/code&gt;, but milk is requiring &lt;code&gt;coffee-script&lt;/code&gt; anywhere from &lt;code&gt;0.9.6&lt;/code&gt; - &lt;code&gt;1.0.0&lt;/code&gt;. &lt;code&gt;npm install&lt;/code&gt; is run, we develop our app, everything is hunky-dory.&lt;/p&gt;

&lt;p&gt;📼 Now let's fast-forward 2 months. Someone finds your project and wants to contribute. They fork and clone your repo, run &lt;code&gt;npm install&lt;/code&gt;, aaaaand it doesn't work. "But it worked on my machine!" you cry. When your collaborator installed the node modules, they were guaranteed a specific version of &lt;code&gt;milk&lt;/code&gt;, but they got a &lt;em&gt;different&lt;/em&gt; version of &lt;code&gt;coffee-script&lt;/code&gt; because &lt;code&gt;milk&lt;/code&gt;'s package.json used semver. &lt;/p&gt;

&lt;h2&gt;
  
  
  🗿 Setting your dependencies in stone
&lt;/h2&gt;

&lt;p&gt;One solution to this is to use a &lt;code&gt;package-lock.json&lt;/code&gt; file. This file gives you &lt;em&gt;very&lt;/em&gt; granular control over the versions of &lt;strong&gt;every&lt;/strong&gt; dependency that you install. If your &lt;code&gt;package.json&lt;/code&gt; is like the shopping list, then your &lt;code&gt;package-lock.json&lt;/code&gt; is like a budget. You can have cereal, but it's gonna be store brand instead of Cap'n Crunch. This specificity runs all the way down every branch of your dependency tree. You must have a &lt;code&gt;package.json&lt;/code&gt; if you want to use a lock file (the &lt;code&gt;package.json&lt;/code&gt; does a lot more than just dependency management, that's just the focus of this post).&lt;/p&gt;

&lt;h2&gt;
  
  
  🎁 Wrapping up
&lt;/h2&gt;

&lt;p&gt;I personally feel that a &lt;code&gt;package-lock.json&lt;/code&gt; file should always be used (in newer versions of npm, it is actually automatically generated). It just makes everything more reliable across environments and deployments. Here's some last little nuggets to hopefully help out when it comes to dependecies:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;npm install --save&lt;/code&gt; will automatically update your lockfile and package.json with that package.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;npm ci&lt;/code&gt; instead of just &lt;code&gt;npm install&lt;/code&gt; will automatically rebuild your node modules, and build from your lockfile. It's a really helpful command for CI/CD and generally best to use in tandem with a lockfile.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;For larger projects, and super robust dependency, check out docker and containers. It can function almost like a virtual machine that perfectly contains your code and it's dependencies, and is cloned to promote to different environments. So hopefully you end up with a lot less "it worked on my machine" kind of issues.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thanks for reading all! Let me know in the comments if I made any egregious errors or left something important out.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fexternal-content.duckduckgo.com%2Fiu%2F%3Fu%3Dhttps%253A%252F%252Fmedia.giphy.com%252Fmedia%252FEkSOkZYz8rwrK%252Fgiphy.gif%26f%3D1%26nofb%3D1" 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%2Fexternal-content.duckduckgo.com%2Fiu%2F%3Fu%3Dhttps%253A%252F%252Fmedia.giphy.com%252Fmedia%252FEkSOkZYz8rwrK%252Fgiphy.gif%26f%3D1%26nofb%3D1" alt="Han Solo see you in hell!"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;MTFBWY&lt;/code&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>npm</category>
      <category>node</category>
    </item>
    <item>
      <title>Intro to pseudo CSS superpowers</title>
      <dc:creator>mikel brierly</dc:creator>
      <pubDate>Sat, 08 Aug 2020 02:59:19 +0000</pubDate>
      <link>https://dev.to/mikel_brierly/intro-to-pseudo-superpowers-in-css-136g</link>
      <guid>https://dev.to/mikel_brierly/intro-to-pseudo-superpowers-in-css-136g</guid>
      <description>&lt;p&gt;When folks are learning HTML, CSS, and web development in general, the concepts of elements, classes, and selectors are all taught early on, and often grasped quickly. But what about their weird, colon-prefixed cousins that are often avoided and misunderstood?&lt;/p&gt;




&lt;h5&gt;
  
  
  &lt;em&gt;pseudo classes, pseudo elements, and pseudo selectors. pseudo is my pseuperhero&lt;/em&gt;
&lt;/h5&gt;




&lt;h2&gt;
  
  
  Let's recap some foundational pieces:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;An &lt;code&gt;element&lt;/code&gt; is an HTML tag. Any valid markup with &lt;code&gt;&amp;lt;brackets&amp;gt;&lt;/code&gt; is an &lt;code&gt;element&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A CSS &lt;code&gt;class&lt;/code&gt; is an identifier you give to one or more &lt;code&gt;element&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A CSS &lt;code&gt;selector&lt;/code&gt; can be used to access HTML &lt;code&gt;elements&lt;/code&gt; by their &lt;code&gt;class&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yXCLjU4p--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/vfk1tgi2ax37kvs5152d.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yXCLjU4p--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/vfk1tgi2ax37kvs5152d.gif" alt='Lloyd sarcastically mouthing "uh yeah" from Dumb and Dumber'&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;em&gt;Alright fine&lt;/em&gt;, let's get into it:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;code&gt;pseudo-class&lt;/code&gt; targets the &lt;em&gt;state&lt;/em&gt; of an &lt;code&gt;element&lt;/code&gt; rather than the element itself.
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gt61rh7C--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/uzit6l0bz7utfuyiz0kb.png" alt="Alt Text"&gt;
Pseudo-classes always (should) follow a CSS &lt;code&gt;selector&lt;/code&gt; and are preceded by a single colon &lt;code&gt;:&lt;/code&gt;. &lt;/li&gt;
&lt;/ul&gt;




&lt;ul&gt;
&lt;li&gt;A &lt;code&gt;pseudo-element&lt;/code&gt; is an "invisible" element originating from your CSS that is intended purely for styling purposes. (It does not become part of the DOM)
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--N_3tRuFj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/oejwhvwbbu3087ptzrss.png" alt="Alt Text"&gt;
Pseudo-elements always (should) follow a CSS selector and are preceded by two colons &lt;code&gt;::&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;Here's what that would look like in the wild:&lt;/em&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bZ_5mZr8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/tiijxzawyfjhau4srxaw.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bZ_5mZr8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/tiijxzawyfjhau4srxaw.gif" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Y50Ev0Qq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/yn5sfzxhlwn5lxeii61x.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Y50Ev0Qq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/yn5sfzxhlwn5lxeii61x.gif" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
☝️ &lt;em&gt;Those are some big honkin gifs, so give 'em a sec&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;And after those updates, the HTML in the inspector will show this:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--G6PoyXME--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/c86q167h8mvabh2ojhp8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--G6PoyXME--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/c86q167h8mvabh2ojhp8.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;code&gt;::before&lt;/code&gt; and &lt;code&gt;::after&lt;/code&gt; are unique in the sense that they accept a "content" property. Without this property, the pseudo-element will not be style-able by your CSS. Often you will see &lt;code&gt;content: ""&lt;/code&gt; if the pseudo-element is &lt;em&gt;only&lt;/em&gt; needed for styling. This is called &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Generated_Content"&gt;generated content&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;If you hear the term &lt;code&gt;pseudo-selector&lt;/code&gt;, it is an umbrella term covering both pseudo-element-selectors and pseudo-class-selectors. You can always tell the difference by checking to see how many colons there are. One for pseudo-class, two for pseudo-element.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;caveat from MDN: &lt;br&gt;
As a rule, double colons (::) should be used instead of a single colon (:). This distinguishes pseudo-classes from pseudo-elements. However, since this distinction was not present in older versions of the W3C spec, most browsers support both syntaxes for the original pseudo-elements.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Thanks for reading! If you're interested in learning more, &lt;a href="https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Selectors/Pseudo-classes_and_pseudo-elements"&gt;MDN&lt;/a&gt; has all the goodies (as per usual). 🍻
&lt;/h3&gt;

</description>
      <category>css</category>
      <category>webdev</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>A brutally honest look back at the beginning of my career</title>
      <dc:creator>mikel brierly</dc:creator>
      <pubDate>Wed, 22 Jul 2020 12:55:58 +0000</pubDate>
      <link>https://dev.to/mikel_brierly/a-brutally-honest-look-back-at-the-beginning-of-my-career-hmf</link>
      <guid>https://dev.to/mikel_brierly/a-brutally-honest-look-back-at-the-beginning-of-my-career-hmf</guid>
      <description>&lt;p&gt;&lt;em&gt;TL;DR&lt;/em&gt;&lt;br&gt;
&lt;em&gt;I struggled through a coding bootcamp, polished up a mediocre final project and got hired at a start up that was gambling on low salary bootcampers to find a &lt;a href="https://www.atlanticbt.com/insights/myth-full-stack-unicorn-developer"&gt;unicorn&lt;/a&gt;. I lazily coasted through a corporate buy-out that left me over-valued because of my "domain knowledge". After 4 years of learning very little, I'm owning my dev journey and working to get better and share with others.&lt;/em&gt;&lt;/p&gt;



&lt;p&gt;4 years ago I graduated from a 6 month coding bootcamp called Galvanize. I was closer to the bottom of my class, and always took up offers for after class workshops to help struggling students understand concepts the rest of the class seemed to get immediately. I worked hard and made some awesome friendships, and managed to make it through the whole thing with a lot of help from my peers. Before we "graduated" (unaccredited af) we created capstone projects to present to our cohort and a handful of prospective employers who partnered with Galvanize. My project was an overly ambitious app called "Desk" that had a calculator, notepad, contacts list, etc. It was really just a cobbled together group of "hello world" tutorials and libraries that I slapped some CSS on. (&lt;a href="https://introtodesk.firebaseapp.com"&gt;Here's the splash page if you're curious.&lt;/a&gt;) The site had a busted FB login page, I couldn't get my DB set up properly, and I didn't really understand a lot of the frameworks I was working with. I also massively underestimated the effort it would take to build what I really wanted. &lt;/p&gt;



&lt;p&gt;By the time the presentation day had come, I had removed all backend logic, (the "login" page was all for show), and when you closed your browser, the session would lose any and all data. It was 95% CSS with loads of dead node.js code. So naturally I did my presentation as if nothing were wrong, carefully traversing the minefield of bugs and things that didn't work. I was insanely nervous, but it went alright, and it looked more put together than it really was (like a lot of engineers you'll meet out there). If you want to watch and cringe knowing what's really going on, here ya go...&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/J5zCcZYa49E"&gt;
&lt;/iframe&gt;
&lt;/p&gt;




&lt;p&gt;After the presentations, everyone in our class met with a few companies and recruiters that came out to &lt;em&gt;maybe&lt;/em&gt; hire juniors. I was unbelievably fortunate to get scheduled for an interview at a small local company. Five or six of my Galvanize friends landed interviews as well, and I happened to be scheduled as the last one. When each one finished their interview, we all would swarm in to hear the horrors of what we might be in for at the mercy of the dreaded whiteboard. Everyone shared what their experiences were, and they all seemed to be focused on similar topics with matrixes and arrays and hoop-jumping circus acts. So I found as many coding challenges as I could that seemed to be in that wheelhouse, and prayed to the gods that I studied the right stuff. &lt;/p&gt;




&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yOwVzekj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/8js2lmlu7i8tnz9mujfv.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yOwVzekj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/8js2lmlu7i8tnz9mujfv.jpeg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When my number was up, I met with some really nice senior engineers that did their best to put me at ease and make it as painless as possible. They gave me a problem on the whiteboard that thankfully was matrix related, and had to do with finding a duplicate or something like that. I got it super wrong. Even after studying pretty much that exact problem I totally biffed it. &lt;em&gt;But&lt;/em&gt; what I did do was explain my thought process and vocalized what my logic was to get me in this completely wrong rabbit hole &lt;em&gt;(ex: I rephrased the question and wrote it on the board, broke it down into small pieces and wrote those goals down, and then talked about what I might do to solve each small little piece)&lt;/em&gt; In having that conversation, the interviewers were able to probe my thinking and give me pointers. Those exchanges helped to ease the stress of the experience. A conversation is always much easier than a performance. &lt;/p&gt;

&lt;p&gt;After my brain fart was erased from the whiteboard and it was all over, they thanked me and said they'd be in touch. A very stressful week later I found out that they had offered me a junior dev role that I grabbed onto like a life preserver. I really, truly felt like I had gamed the system. Like I lied to them about who I was, and what I could do. Even outside of my capstone project being misleading and maybe even dishonest, I thought myself a fraud of massive proportions.&lt;/p&gt;




&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--y99MhtQ9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/wcgcdtvn6a9guptdrm27.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--y99MhtQ9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/wcgcdtvn6a9guptdrm27.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;I should know all this stuff right? I don't think I can explain what problems Node solves, I can't even remember the syntax to a "for" loop without googling it. Most of the code I've written that works was copy-pasted... Who am I kidding?&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;Every day for the first 2 years at my job I felt like I was putting on the same front I did when I presented my capstone. I tried to avoid topics I didn't understand. I tried to get assigned work that didn't highlight my shortcomings. Most days I was incredibly paranoid that my ignorance would come to light and I would be scoffed at and shown the exit. But it never happened.&lt;/p&gt;

&lt;p&gt;I just kept following the status quo set by my coworkers, and those feelings slowly started to be less pervasive. I became familiar with our companies systems and painfully outdated tech stack enough to hack around and make things work, but I wasn't much of a better developer than I was when I started. I was just learning what other people did to hide their lack of knowledge and understanding. &lt;/p&gt;

&lt;p&gt;I learned that jargon was better than terminology, a blog post title could give you ammunition to belittle the decisions of others, being a senior engineer meant being able to deflect work by spouting abstract complaints about architecture choices, and that being a developer meant writing unsustainable code and claiming that if "they" wanted it done right, they should've given us more time. It wasn't a healthy environment to learn in, but I inevitably absorbed some of those toxic ideas.&lt;/p&gt;




&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--04hEBUFt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/azwjjha3zpdr8hx5up5i.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--04hEBUFt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/azwjjha3zpdr8hx5up5i.jpeg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We were eventually acquired by a large corporation that promised to bring change, but it never came. Promises of better leadership and opportunities were unfulfilled, and work went on like it always had.&lt;/p&gt;

&lt;p&gt;Now four years later, I feel like I've barely moved the needle at all. I let stagnation get to me and poison my work ethic. But I'm done with that. I need to take control of my own journey, and that's what I'm going to do.&lt;/p&gt;




&lt;p&gt;We are so incredibly lucky to be where we are today as developers. We stand on the shoulders of millions of brilliant people that have made engineering and the web what it is today. And we have a community of people that want to help and share and grow together. We live in an amazing time.&lt;/p&gt;

&lt;p&gt;I'm really excited to be starting a new chapter in my development journey that is focused on self improvement, learning, and positive creativity. I'm looking forward to sharing with and learning from all of you along the way.&lt;/p&gt;




&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BSJ1cmgw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/yj8nzp4uzwn6hxxpboam.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BSJ1cmgw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/yj8nzp4uzwn6hxxpboam.jpeg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To anyone starting out who might be struggling, I want you to know that every single successful engineer you look up to has felt the same fears and doubts you feel now. It takes a lot to push through, but you can. Never &lt;em&gt;ever&lt;/em&gt; quit because you think you're not good enough. &lt;strong&gt;You are.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;MTFBWY&lt;/code&gt;&lt;/p&gt;

</description>
      <category>career</category>
      <category>webdev</category>
    </item>
    <item>
      <title>What were your knowledge gaps when you started your career?</title>
      <dc:creator>mikel brierly</dc:creator>
      <pubDate>Mon, 20 Jul 2020 13:40:17 +0000</pubDate>
      <link>https://dev.to/mikel_brierly/what-were-your-knowledge-gaps-when-you-started-your-career-17gm</link>
      <guid>https://dev.to/mikel_brierly/what-were-your-knowledge-gaps-when-you-started-your-career-17gm</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rQFyIRDP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/nu6lsnaortmr9n8hj6iz.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rQFyIRDP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/nu6lsnaortmr9n8hj6iz.gif" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;When developers sweep mistakes under the rug and cover up gaps in understanding with jargon and obfuscation, we reinforce the wall of imposter syndrome. Let's be inclusive and share what this journey is really like, warts and all.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Stuff I think is reasonable to not understand:&lt;/strong&gt;&lt;br&gt;
📌 higher-order functions, threads, closure, execution context, recursion, OOP vs Functional programming, a million acronyms everyone seemed to be throwing around&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stuff I probably should have known:&lt;/strong&gt;&lt;br&gt;
📌 Using an IDE, the difference between front-end and back-end, Node debugging and Chrome dev tools basics, using &lt;code&gt;debugger&lt;/code&gt; instead of &lt;code&gt;console.log&lt;/code&gt;, what is pure JS syntax and what is framework,&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stuff I'm not sure is "beginner" or not:&lt;/strong&gt;&lt;br&gt;
📌 &lt;code&gt;this&lt;/code&gt; and &lt;code&gt;prototype&lt;/code&gt;, merge conflict resolution, [reading [documentation]], the call stack, web API&lt;/p&gt;




&lt;p&gt;I'm really curious what your thoughts are on this, and what your own lists will look like! &lt;/p&gt;

&lt;p&gt;&lt;code&gt;MTFBY&lt;/code&gt;&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>beginners</category>
      <category>career</category>
      <category>codenewbie</category>
    </item>
  </channel>
</rss>
