<?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: Harvey</title>
    <description>The latest articles on DEV Community by Harvey (@harvey).</description>
    <link>https://dev.to/harvey</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%2F144151%2F1c1bc824-192e-4621-a0a0-f6fde01bfb25.jpeg</url>
      <title>DEV Community: Harvey</title>
      <link>https://dev.to/harvey</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/harvey"/>
    <language>en</language>
    <item>
      <title>Comparing currency devaluation with Python</title>
      <dc:creator>Harvey</dc:creator>
      <pubDate>Fri, 11 Jun 2021 09:06:14 +0000</pubDate>
      <link>https://dev.to/harvey/comparing-currency-devaluation-with-python-2gk9</link>
      <guid>https://dev.to/harvey/comparing-currency-devaluation-with-python-2gk9</guid>
      <description>&lt;p&gt;As the old saying goes, "money makes the world go around". Sure enough, money is the easiest way to measure a country's economic health, or at least its purchasing power. &lt;/p&gt;

&lt;p&gt;Data about purchasing power is publicly available at statista. We can use matplotlib to plot a &lt;a href="https://pythonbasics.org/matplotlib-line-chart/"&gt;line chart&lt;/a&gt; and compare the devaluation process of currencies.&lt;/p&gt;

&lt;p&gt;For the &lt;a href="https://www.statista.com/statistics/1055948/value-euro-since-2000/"&gt;euro&lt;/a&gt; the purchasing power data from 2000 to 2020 is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt; &lt;span class="mf"&gt;1.39&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.36&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.33&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.28&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.25&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.22&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.15&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.13&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.08&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.06&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.06&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.06&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.06&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.04&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.02&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.01&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The code below plots the devaluation of the euro:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;matplotlib.pyplot&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;plt&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;numpy&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;

&lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt; &lt;span class="mf"&gt;1.39&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.36&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.33&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.28&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.25&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.22&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.15&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.13&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.08&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.06&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.06&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.06&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.06&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.04&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.02&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.01&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; 

&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;figure&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;plot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;show&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For the dollar the devaluation is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt; &lt;span class="mf"&gt;1.51&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.47&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.45&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.41&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.38&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.33&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.29&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.26&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.21&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.19&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.13&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.12&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.08&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.06&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.04&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.02&lt;/span&gt; &lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The numbers are not in the same range, so you need to normalize them.  I will normalize against the maximum, not normalize against the sum. To normalize against the maximum you can use&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;norm&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;float&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nb"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;raw&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;raw&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ofcourse I add a &lt;a href="https://pythonspot.com/matplotlib-legend/"&gt;legend&lt;/a&gt; to the plot to show the currency. &lt;br&gt;
That gives us this plot:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;matplotlib.pyplot&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;plt&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;numpy&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;

&lt;span class="n"&gt;eur&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt; &lt;span class="mf"&gt;1.39&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.36&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.33&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.28&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.25&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.22&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.15&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.13&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.08&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.06&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.06&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.06&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.06&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.04&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.02&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="n"&gt;usd&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt; &lt;span class="mf"&gt;1.51&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.47&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.45&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.41&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.38&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.33&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.29&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.26&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.21&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.19&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.13&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.12&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.08&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.06&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.04&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.02&lt;/span&gt; &lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;eur&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

&lt;span class="n"&gt;y_eur&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;float&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nb"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;eur&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;eur&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;y_usd&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;float&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nb"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;usd&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;usd&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;figure&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;plot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;y_eur&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;plot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;y_usd&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ylabel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Purchasing power"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;xlabel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Year"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;legend&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="s"&gt;'eur'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s"&gt;'usd'&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;show&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;The trend is similar in both currencies. This program should work with any currency&lt;/p&gt;

</description>
      <category>python</category>
    </item>
    <item>
      <title>Why I Switched to vi/vim</title>
      <dc:creator>Harvey</dc:creator>
      <pubDate>Mon, 31 May 2021 10:58:53 +0000</pubDate>
      <link>https://dev.to/harvey/why-i-switched-to-vi-vim-4hd1</link>
      <guid>https://dev.to/harvey/why-i-switched-to-vi-vim-4hd1</guid>
      <description>&lt;p&gt;When I started writing code, I used Notepad and Notepad++. When I switched to OS X. In my first computer science class in high school we used Visual Studio.&lt;/p&gt;

&lt;p&gt;When I finally migrated to Linux, I started using vi/vim after using nano for a while. Unlike nano, vim is a lot more powerful but is harder to learn.&lt;/p&gt;

&lt;p&gt;How did I go from never using &lt;a href="http://www.vim.org/"&gt;vim&lt;/a&gt; to using it all the time? How does one make a complete switch? I'll walk you through how I got here and share some tips along the way.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reasons to learn vim
&lt;/h2&gt;

&lt;p&gt;If you are trying to learn Vim, or you are on the fence about it, here are my top 5 reasons why I love this keyboard-centered editor:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The more I used it, the faster I became, and the faster I became the more productive I was.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It's everywhere. &lt;a href="https://bsdnerds.org/what-is-linux-shell/"&gt;Linux&lt;/a&gt;, OpenBSD, FreeBSD, Mac OS X and every other operating system supports Vi/Vim. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I don't like to use my mouse. I never did anything in Sublime Text without the help of my mouse. This is a annoying, easier to keep hands on the keyboard&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It can be used over the network using ssh. Login to any box and use it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I use it for almost everything: programming, writing, blogging, etc.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ztZY-89a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a8ht6ydevzn0dpr7u0bb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ztZY-89a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a8ht6ydevzn0dpr7u0bb.png" alt="vim editor"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why You Should Switch:
&lt;/h2&gt;

&lt;p&gt;Switching is up to you, but here are my reasons.&lt;/p&gt;

&lt;p&gt;Why would somebody use ancient tools like vi/vim when there are so many modern ones out there? &lt;/p&gt;

&lt;p&gt;One day I had to answer this question for my friend. He asked, “Why don’t you use Sublime Text like me?” I explain to him that sometimes it’s better to use older/simpler tools than more complex ones.&lt;/p&gt;

&lt;p&gt;Here are my reasons:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Learn how to use the best editor ever made.&lt;/li&gt;
&lt;li&gt;Never get lost in a sea of menus and toolbars that you never use (just like vim does not have any).&lt;/li&gt;
&lt;li&gt;Have an excuse to use powerful, built-in commands that are available in no other editor (and are faster than anything you can do with a GUI).&lt;/li&gt;
&lt;li&gt;Work fast using commands&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To practice vim, you can use this &lt;a href="https://vim.is/"&gt;site&lt;/a&gt;&lt;/p&gt;

</description>
      <category>linux</category>
      <category>vim</category>
    </item>
    <item>
      <title>7 Ways to Use Your Linux Terminal</title>
      <dc:creator>Harvey</dc:creator>
      <pubDate>Sun, 30 May 2021 09:40:19 +0000</pubDate>
      <link>https://dev.to/harvey/7-ways-to-use-your-linux-terminal-4fk6</link>
      <guid>https://dev.to/harvey/7-ways-to-use-your-linux-terminal-4fk6</guid>
      <description>&lt;p&gt;The terminal is the command line interface (CLI) to a Linux or Unix-like computer operating system. It’s a place where you can type in commands and get things done. Here are 7 ways to use your Linux terminal&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Manage your hard drive&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In order to get anything done with your computer, you will need to manage your hard drive. Using commands in your terminal, you can easily perform tasks like creating, moving, copying and deleting files. &lt;/p&gt;

&lt;p&gt;It's important to note that these commands can be destructive, so any &lt;code&gt;rm&lt;/code&gt; command you perform with them will remove data from your computer &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Manage Your Cloud Servers&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can connect to your cloud servers / vps servers using a program called ssh. After logging in to your server, you can use any Linux command.&lt;/p&gt;

&lt;p&gt;One click deploy vps servers and then control them using the command line. Any Linux distribution or operating system you want.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7zZsxIla--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/52csz787m6b0aeedu1fl.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7zZsxIla--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/52csz787m6b0aeedu1fl.gif" alt="linux power"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Keep the logs&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You often hear tales of sysadmins having a thing for “the logs”. Many of the troubleshooting problems can be solved if you know what was going on in the logs.&lt;/p&gt;

&lt;p&gt;Log files are stored in the directory &lt;code&gt;/var/log&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; /var/log
&lt;span class="nb"&gt;ls
cat &lt;/span&gt;syslog
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;4. Development&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It's easy to do development in the terminal. Because there are so many commands aimed at developers like ssh, gcc, g++, python, go etc. &lt;/p&gt;

&lt;p&gt;The editor vim is great for development too, although it has quite a steep learning curve. You can learn &lt;a href="https://vim.is"&gt;by exercise&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9qf_w4bc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0qu7to3us0nav8jkkb1f.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9qf_w4bc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0qu7to3us0nav8jkkb1f.jpg" alt="vim editor for development"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Run a server&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Linux is the most widely used server operating system in the world. You can deploy a web server on your box for development. &lt;/p&gt;

&lt;p&gt;These days nginx is used quite a lot, in the past it was Apache. Regardless of which server software you use, you will have to &lt;a href="https://bsdnerds.org/7-top-nginx-security-pracitces/"&gt;secure your server&lt;/a&gt; if you open it to the internet.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Install software&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can remove and install software using the terminal. Every Linux distribution has their own package manager. The most common ones are &lt;strong&gt;apt&lt;/strong&gt; (Debian, Ubuntu, Mint), &lt;strong&gt;rpm&lt;/strong&gt; and &lt;strong&gt;yum&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Because there's lots of open source software, you can compile it yourself too. Run the commands shown below&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./configure
make
&lt;span class="nb"&gt;sudo &lt;/span&gt;make &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;7. Play Games&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Entertainment. There are plenty of games you can play in the terminal, including Tetris and Snake. &lt;/p&gt;

&lt;p&gt;Tetris is probably the most well-known terminal game, but it’s actually quite old and has been around since the early days of Unix.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8. More&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There are many more &lt;a href="https://bsdnerds.org/what-is-linux-shell/"&gt;Linux commands&lt;/a&gt; and you can do many things with terminal than the ones shown here.&lt;/p&gt;

&lt;p&gt;If you want to improve your Linux skils, you can use &lt;a href="https://www.practicelinux.com/"&gt;this site&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>The Vim Cheat Sheet</title>
      <dc:creator>Harvey</dc:creator>
      <pubDate>Sat, 29 May 2021 14:53:48 +0000</pubDate>
      <link>https://dev.to/harvey/the-vim-cheat-sheet-5624</link>
      <guid>https://dev.to/harvey/the-vim-cheat-sheet-5624</guid>
      <description>&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Vim_(text_editor)"&gt;Vim&lt;/a&gt; is a highly configurable text editor built to enable efficient text editing. It is an improved version of the vi editor distributed with most UNIX systems.&lt;/p&gt;

&lt;p&gt;Vim is often used by programmers on &lt;a href="https://bsdnerds.org/what-is-linux-shell/"&gt;Linux&lt;/a&gt;. But it can be used on Mac OS X and Windows too.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rQPBzFZj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0e6dlbe8t96rm5oa3k07.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rQPBzFZj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0e6dlbe8t96rm5oa3k07.gif" alt="vim text editor"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Vim is a powerful text editor that runs in a terminal, yet can be used to edit any kind of file. It's old, it's weird, and it's hard to learn but also one of the most powerful tools for editing code on any operating system.&lt;/p&gt;

&lt;p&gt;So what about commands?&lt;/p&gt;

&lt;h2&gt;
  
  
  Vim commands
&lt;/h2&gt;

&lt;p&gt;Here's a handy cheat sheet to help you get started with the editor. &lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Cursor Movement&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;h&lt;/td&gt;
&lt;td&gt;move cursor left&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;j&lt;/td&gt;
&lt;td&gt;move cursor down&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;k&lt;/td&gt;
&lt;td&gt;move cursor up&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;l&lt;/td&gt;
&lt;td&gt;move cursor right&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;w&lt;/td&gt;
&lt;td&gt;jump forwards to the start of a word&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;b&lt;/td&gt;
&lt;td&gt;jump backwards to the start of a word&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;To write and to use commands press &lt;code&gt;ESC&lt;/code&gt; for command mode or &lt;code&gt;i&lt;/code&gt; for insert mode.&lt;/p&gt;

&lt;p&gt;To save, open and quit a file:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Basic editor commands&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;:e filename&lt;/td&gt;
&lt;td&gt;edit a file in a new buffer&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;:w&lt;/td&gt;
&lt;td&gt;write (save) the file, but don't exit&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;:wq&lt;/td&gt;
&lt;td&gt;write (save) and quit&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;:x&lt;/td&gt;
&lt;td&gt;write (save) and quit&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;:q&lt;/td&gt;
&lt;td&gt;quit (fails if there are unsaved changes)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;:q!&lt;/td&gt;
&lt;td&gt;quit and throw away unsaved changes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;:qa&lt;/td&gt;
&lt;td&gt;quit all buffers and windows&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ZZ&lt;/td&gt;
&lt;td&gt;write (save) current file, if modified, and quit&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ZQ&lt;/td&gt;
&lt;td&gt;quit without checking for changes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;You can copy and paste text too:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Cut and Paste&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;yy&lt;/td&gt;
&lt;td&gt;yank (copy) a line&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2yy&lt;/td&gt;
&lt;td&gt;yank (copy) 2 lines&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;p&lt;/td&gt;
&lt;td&gt;put (paste) the clipboard after cursor&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;P&lt;/td&gt;
&lt;td&gt;put (paste) before cursor&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;dd&lt;/td&gt;
&lt;td&gt;delete (cut) a line&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2dd&lt;/td&gt;
&lt;td&gt;delete (cut) 2 lines&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;There are quite a few commands you have to memorize to use Vim effectively, which can be overwhelming when you’re learning. &lt;/p&gt;

&lt;p&gt;You can use &lt;a href="https://vim.is"&gt;these exercises&lt;/a&gt; to memorize commands.&lt;/p&gt;

</description>
      <category>vim</category>
      <category>linux</category>
    </item>
    <item>
      <title>vim vs. emacs</title>
      <dc:creator>Harvey</dc:creator>
      <pubDate>Sat, 29 May 2021 14:05:56 +0000</pubDate>
      <link>https://dev.to/harvey/vim-vs-emacs-5e96</link>
      <guid>https://dev.to/harvey/vim-vs-emacs-5e96</guid>
      <description>&lt;p&gt;&lt;a href="https://www.vim.org/"&gt;Vim&lt;/a&gt; and &lt;a href="https://www.gnu.org/software/emacs/"&gt;emacs&lt;/a&gt; are two of the most popular text editors in the world. They are very different, with a different design philosophy.&lt;/p&gt;

&lt;p&gt;Vim and Emacs are still used to this day and are both great choices 😁&lt;/p&gt;

&lt;p&gt;Vim's main advantage is that it is very good at being a text editor and that you can do a lot without having to learn anything new.&lt;/p&gt;

&lt;p&gt;You can install plugins, change key mappings, etc. either with the builtin scripting language or by sourcing scripts from your .vimrc .&lt;/p&gt;

&lt;p&gt;Emacs is a text editor but more than that. It can be used for email, browsing the internet and a lot more.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is vim?
&lt;/h2&gt;

&lt;p&gt;Vim is a modal editor. It operates in either the insert mode (where keystrokes are entered and text is composed) or the command mode (where text can be moved and modified). &lt;/p&gt;

&lt;p&gt;It is not until you exit command mode and return to the default, or "normal" mode that the text you have typed will appear on screen 💻&lt;/p&gt;

&lt;p&gt;Entering command mode is simple: hit the esc key. Esc takes you back to normal mode and whatever you typed in command mode will be executed. &lt;/p&gt;

&lt;p&gt;Most of the commands have a corresponding control key, so for example the command to move the cursor forward one word is &lt;code&gt;w&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;To practice vim you can use &lt;a href="https://vim.is"&gt;this site&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9pP1Mqj5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xbbrkth3q1bxwxcc4pee.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9pP1Mqj5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xbbrkth3q1bxwxcc4pee.gif" alt="vim editor"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is emacs?
&lt;/h2&gt;

&lt;p&gt;The emacs editor is very user friendly and easy to pick up especially if you have used other graphical user interfaces (such as those used on Windows and Mac) before using it. &lt;/p&gt;

&lt;p&gt;It includes a very handy feature called auto-completion. This allows you to start typing a command and the editor will automatically complete it for you after pressing the tab key a couple times.&lt;/p&gt;

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

&lt;h2&gt;
  
  
  My choice
&lt;/h2&gt;

&lt;p&gt;I’m a vim user. I used to use emacs but moved to vim a couple years ago. I can never go back. My reasons for switching were:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Vi/Vim is always installed or available on computers&lt;/li&gt;
&lt;li&gt;In emacs, the keys are not contiguous. In vim, they are.&lt;/li&gt;
&lt;li&gt;In emacs, the keys are not in alphabetical order. In vim, they are.&lt;/li&gt;
&lt;li&gt;I like all my commands to be on a single keystroke (or two). You can get there with a key-chord, but why?&lt;/li&gt;
&lt;li&gt;Vim is minimalist. I want a program to do one thing (Text editing), not be also an email client, browser etc&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Both support keyboard macros, which saves a lot of time. &lt;/p&gt;

&lt;p&gt;The design of vim is very simple and extremely efficient, but also very different from what you may expect: there are no appeals to common sense! &lt;/p&gt;

&lt;p&gt;For example, instead of having buttons that say "cut" and "copy", you're expected to remember that "d" means "delete".&lt;/p&gt;

&lt;p&gt;That may seem strange, but once you get used to it, you never want to go back.&lt;/p&gt;

</description>
      <category>vim</category>
      <category>linux</category>
    </item>
    <item>
      <title>The Top 10 Linux Commands Every Programmer Should Know</title>
      <dc:creator>Harvey</dc:creator>
      <pubDate>Fri, 28 May 2021 19:44:37 +0000</pubDate>
      <link>https://dev.to/harvey/the-top-10-linux-commands-every-programmer-should-know-11hf</link>
      <guid>https://dev.to/harvey/the-top-10-linux-commands-every-programmer-should-know-11hf</guid>
      <description>&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Linux" rel="noopener noreferrer"&gt;Linux&lt;/a&gt; systems are powerful operating systems with endless possibilities. However, learning to use this amazing OS can be difficult if you’re new to the Linux world. &lt;/p&gt;

&lt;p&gt;You could spend days browsing through forums, copy/pasting code and never really knowing what’s going on or why it works. If you want to learn commands, I recommend &lt;a href="https://practicelinux.com/" rel="noopener noreferrer"&gt;this site&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Enter the Command Line
&lt;/h2&gt;

&lt;p&gt;My first tip is pretty basic, but very important. Before you can run any of these commands, you’ll need to start the terminal.&lt;/p&gt;

&lt;p&gt;One way is to enter the terminal outside of the GUI. X11 or Wayland provides the graphical user interface on linux. You can switch to the terminal by pressing Alt+Ctrl+F1 to F12.&lt;/p&gt;

&lt;p&gt;You can also start a graphical terminal. There are many variants like gnome-terminal, konsole, xterm, kitty and many others.&lt;/p&gt;

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

&lt;p&gt;The Linux Command Line is a powerful tool every programmer should know, even if they don't use linux. It is also a dangerous weapon that can lead to potential disaster if it is used improperly. So, which are the essential &lt;a href="https://bsdnerds.org/what-is-linux-shell/" rel="noopener noreferrer"&gt;commands&lt;/a&gt; that a programmer needs to know?&lt;/p&gt;

&lt;h2&gt;
  
  
  The mkdir command
&lt;/h2&gt;

&lt;p&gt;The mkdir command allows you to create directories. You can also give it an optional -p flag to create any needed parent directories along with the directory itself.&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;folder
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The ll command
&lt;/h2&gt;

&lt;p&gt;The ll command lets you see the files and folders in a directory. It has several useful options such as showing the file size, permission mode, and more.&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="nv"&gt;$ &lt;/span&gt;ll
total 2097256
drwxr-xr-x  20 root root       4096 jun  4  2021 ./
drwxr-xr-x  20 root root       4096 jun  4  2021 ../
lrwxrwxrwx   1 root root          7 jun  4  2021 bin -&amp;gt; usr/bin/
drwxr-xr-x   4 root root       4096 mei 28 18:31 boot/
drwxrwxr-x   2 root root       4096 jun  4  2021 cdrom/
drwxr-xr-x  21 root root       4780 mei 28 20:43 dev/
drwxr-xr-x 153 root root      12288 mei 28 18:31 etc/
drwxr-xr-x   3 root root       4096 apr  6 14:20 home/
lrwxrwxrwx   1 root root          7 jun  4  2021 lib -&amp;gt; usr/lib/
lrwxrwxrwx   1 root root          9 jun  4  2021 lib32 -&amp;gt; usr/lib32/
lrwxrwxrwx   1 root root          9 jun  4  2021 lib64 -&amp;gt; usr/lib64/
lrwxrwxrwx   1 root root         10 jun  4  2021 libx32 -&amp;gt; usr/libx32/
drwx------   2 root root      16384 jun  4  2021 lost+found/
drwxr-xr-x   3 root root       4096 apr 24 15:24 media/
drwxr-xr-x   2 root root       4096 feb  9 19:47 mnt/
drwxr-xr-x   2 root root       4096 feb  9 19:47 opt/
dr-xr-xr-x 269 root root          0 mei 28 19:10 proc/
drwx------  10 root root       4096 mei 23 20:00 root/
drwxr-xr-x  35 root root        920 mei 28 20:02 run/
lrwxrwxrwx   1 root root          8 jun  4  2021 sbin -&amp;gt; usr/sbin/
drwxr-xr-x  17 root root       4096 mei 25 01:18 snap/
drwxr-xr-x   2 root root       4096 feb  9 19:47 srv/
&lt;span class="nt"&gt;-rw-------&lt;/span&gt;   1 root root 2147483648 jun  4  2021 swapfile
dr-xr-xr-x  13 root root          0 mei 28 19:10 sys/
drwxrwxrwt  20 root root      20480 mei 28 21:19 tmp/
drwxr-xr-x  14 root root       4096 feb  9 19:48 usr/
drwxr-xr-x  14 root root       4096 feb  9 19:56 var/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn90n0ikr9540hjl44ntf.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%2Fuploads%2Farticles%2Fn90n0ikr9540hjl44ntf.gif" alt="cat"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The cd command 😁
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;cd&lt;/code&gt; (change directory) command lets you move around within your Linux filesystem. &lt;/p&gt;

&lt;p&gt;You'll find yourself using it constantly. Here's an example of how it works:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;Documents
&lt;span class="nb"&gt;cd &lt;/span&gt;Linux&lt;span class="se"&gt;\ &lt;/span&gt;Box&lt;span class="se"&gt;\ &lt;/span&gt;Archive
&lt;span class="nb"&gt;cd&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To list files, type &lt;code&gt;ls&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The rm command
&lt;/h2&gt;

&lt;p&gt;The rm command removes files and folders. It removes it completely from your system, it doesn't put it in a trash can.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rm -rf folder
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  cp
&lt;/h2&gt;

&lt;p&gt;Copies files and directories within the same directory or between two 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;cp&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;option] &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;source&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;target]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;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="nb"&gt;cp &lt;/span&gt;mydoc.doc mydoc_new.doc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Linux tree command 💻
&lt;/h2&gt;

&lt;p&gt;The tree command provides us with a way to get an overview of files and folders and how they are structured in our directories. The tree command is used like that: tree&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="nv"&gt;$ &lt;/span&gt;tree &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="nt"&gt;-L&lt;/span&gt; 1
&lt;span class="nb"&gt;.&lt;/span&gt;
├── bin -&amp;gt; usr/bin
├── boot
├── cdrom
├── dev
├── etc
├── home
├── lib -&amp;gt; usr/lib
├── lib32 -&amp;gt; usr/lib32
├── lib64 -&amp;gt; usr/lib64
├── libx32 -&amp;gt; usr/libx32
├── lost+found
├── media
├── mnt
├── opt
├── proc
├── root
├── run
├── sbin -&amp;gt; usr/sbin
├── snap
├── srv
├── sys
├── tmp
├── usr
└── var
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you change it to L2, it goes a level deeper. There is no limit to how many levels you can go.&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="nv"&gt;$ &lt;/span&gt;tree &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="nt"&gt;-L&lt;/span&gt; 2
...
├── usr
│   ├── bin
│   ├── games
│   ├── include
│   ├── lib
│   ├── lib32
│   ├── lib64
│   ├── libexec
│   ├── libx32
│   ├── &lt;span class="nb"&gt;local&lt;/span&gt;
│   ├── sbin
│   ├── share
│   └── src
└── var
    ├── backups
    ├── cache
    ├── crash
    ├── lib
    ├── &lt;span class="nb"&gt;local&lt;/span&gt;
    ├── lock -&amp;gt; /run/lock
    ├── log
    ├── mail
    ├── metrics
    ├── opt
    ├── run -&amp;gt; /run
    ├── snap
    ├── spool
    └── tmp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  vim editor
&lt;/h2&gt;

&lt;p&gt;vim is an editor which is popular among programmers, especially among Linux enthusiasts.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vim filename
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Vim&lt;/em&gt; or it's older variant &lt;em&gt;vi&lt;/em&gt; is everywhere, on Mac OS X, on servers etc. It has quite a steep learning curve, you can practice &lt;a href="https://vim.is/" rel="noopener noreferrer"&gt;by exercise&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To exit vim press ZQ.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frc8uvwbnb1aziy5jqpt8.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%2Fuploads%2Farticles%2Frc8uvwbnb1aziy5jqpt8.gif" alt="vim text editor"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  grep in files
&lt;/h2&gt;

&lt;p&gt;Using the command &lt;code&gt;grep&lt;/code&gt;, we can search for a specific character pattern inside a file or files. &lt;/p&gt;

&lt;p&gt;You can use it like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;grep word filename
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  sha256sum
&lt;/h2&gt;

&lt;p&gt;This commands allow you to compare file contents to see if their contents are equal, or to test if the file has been changed in any way. &lt;/p&gt;

&lt;p&gt;It creates a unique hash for the file contents. This way you can check if the file has been changed if you send it over the internet.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sha256sum file.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This returns a unique hash for the file.&lt;/p&gt;

&lt;h2&gt;
  
  
  the ifconfig command
&lt;/h2&gt;

&lt;p&gt;This command is used for network configuration. If you want to assign a static IP address, you need to use this command&lt;/p&gt;

</description>
      <category>linux</category>
    </item>
    <item>
      <title>How to Use the Linux Command Line Like a Pro</title>
      <dc:creator>Harvey</dc:creator>
      <pubDate>Fri, 28 May 2021 10:09:03 +0000</pubDate>
      <link>https://dev.to/harvey/how-to-use-the-linux-command-line-like-a-pro-2j1n</link>
      <guid>https://dev.to/harvey/how-to-use-the-linux-command-line-like-a-pro-2j1n</guid>
      <description>&lt;p&gt;Learn how to use the Linux command line to save time and run commands faster. If you use a Unix-based operating system, such as Linux or macOS, you’re probably familiar with the shell, also called the command line. &lt;/p&gt;

&lt;p&gt;The shell lets you interact with your system by entering commands that perform actions. When it comes to mastering the shell, there are a lot of possibilities for streamlining your work.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qWU-2jT5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gfxxm8l0nkr587q0b24p.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qWU-2jT5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gfxxm8l0nkr587q0b24p.gif" alt="learn linux"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Linux shells are a thing of beauty. They are the command line interfaces that power servers, minicomputers, supercomputers, embedded systems - and they are one of the most powerful tools in a system administrator's arsenal.&lt;/p&gt;

&lt;p&gt;A lot of tech professionals use the command line to do their job.&lt;/p&gt;

&lt;p&gt;Learning to use the Bash command line on a Linux-based operating system will change your life. It will save you hours of frustration and anger, level up your career, and improve your life in many other ways. If you want to practice the command line, I recommend &lt;a href="https://practicelinux.com/"&gt;this site&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Show me the power
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Servers&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you use a server or web server for your project, it most likely runs on Linux. You can connect to the server using &lt;a href="https://en.wikipedia.org/wiki/Secure_Shell"&gt;ssh&lt;/a&gt; and control it using commands.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh user@ip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then login and you can control it with commands.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Search files&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The power of the command line lies in its ability to perform tasks faster than you could with an interface alone. For example, if you want to find out where a file is located on your hard drive, you can use Nautilus/Dolphin (or Finder on a Mac) to locate it or &lt;em&gt;just type one command&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;find /home &lt;span class="nt"&gt;-type&lt;/span&gt; f &lt;span class="nt"&gt;-name&lt;/span&gt; filename.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also use the &lt;em&gt;fd&lt;/em&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="o"&gt;&amp;gt;&lt;/span&gt; fd netfl
Software/python/imdb-ratings/netflix-details.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Navigate file system&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can navigate the file system with the &lt;code&gt;cd&lt;/code&gt; and &lt;code&gt;ls&lt;/code&gt; commands. &lt;code&gt;ls&lt;/code&gt; shows you the files in the current directory. &lt;code&gt;cd&lt;/code&gt; changes the directory.&lt;/p&gt;

&lt;p&gt;Some commands include &lt;code&gt;cd ~&lt;/code&gt; go to home directory, &lt;code&gt;cd dir&lt;/code&gt; enter directory, &lt;code&gt;cd ..&lt;/code&gt; leave directory.&lt;/p&gt;

&lt;p&gt;That's all you need to navigate your file system. Here you can find a large &lt;a href="https://bsdnerds.org/what-is-linux-shell/"&gt;list of commands&lt;/a&gt; for Linux.&lt;/p&gt;

</description>
      <category>linux</category>
    </item>
    <item>
      <title>Vim Tips and Tricks</title>
      <dc:creator>Harvey</dc:creator>
      <pubDate>Thu, 27 May 2021 17:47:37 +0000</pubDate>
      <link>https://dev.to/harvey/vim-tips-and-tricks-4hfd</link>
      <guid>https://dev.to/harvey/vim-tips-and-tricks-4hfd</guid>
      <description>&lt;p&gt;The following are my favorite tips and tricks for working with &lt;a href="https://en.wikipedia.org/wiki/Vim_(text_editor)" rel="noopener noreferrer"&gt;Vim&lt;/a&gt;. I use Vim as my primary editor, and try to avoid the use of other IDEs and editors.&lt;/p&gt;

&lt;p&gt;If you're new to vim, or looking to learn more about the features already available, here's a sample of my tips and tricks.&lt;/p&gt;

&lt;p&gt;Vim is often used by &lt;a href="https://bsdnerds.org/what-is-linux-shell/" rel="noopener noreferrer"&gt;Linux&lt;/a&gt; but it works on every system. It's included by default on Mac OS X.&lt;/p&gt;

&lt;h2&gt;
  
  
  Searching for Words
&lt;/h2&gt;

&lt;p&gt;If you type &lt;code&gt;/&lt;/code&gt; then a search term, Vim will start searching forwards from the current cursor location for that word. &lt;/p&gt;

&lt;p&gt;To search for the next occurrence of that search term, press n (for next); to search backwards press N . After pressing n or N , Vim will highlight all matching words, which you can then press on to select.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8o4z6nlbjm8q0rr3uth1.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%2Fuploads%2Farticles%2F8o4z6nlbjm8q0rr3uth1.gif" alt="search"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  ex commands
&lt;/h2&gt;

&lt;p&gt;One of the most powerful features of Vim is its ability to use ex commands. First, in order to run ex commands, you must be in insert mode: that is to say, not at the beginning of a line. &lt;/p&gt;

&lt;p&gt;It’s important to note that in order to enter insert mode, you must first exit normal mode. To do this, press “i” or “a” – these keys will start you off in insert mode at the beginning of a new line or at the end of your current line.&lt;/p&gt;

&lt;p&gt;Now that you’re in insert mode, you can type “:” and then an ex command.&lt;/p&gt;

&lt;p&gt;Some things you can do are:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;:5p&lt;/code&gt; print the fifth line&lt;br&gt;
&lt;code&gt;:100p&lt;/code&gt; print line 100&lt;br&gt;
&lt;code&gt;:%s/hello/world/&lt;/code&gt; search and replace&lt;br&gt;
&lt;code&gt;:!bash&lt;/code&gt; return to bash, type exit to open vim&lt;/p&gt;

&lt;h2&gt;
  
  
  repeat action
&lt;/h2&gt;

&lt;p&gt;This saves you quit a few keystrokes. Press the number of times you want to repeat, then press the key. To move 100 lines down, press &lt;code&gt;100j&lt;/code&gt;. To move up 50 lines, press &lt;code&gt;50k&lt;/code&gt;. To delete 5 lines press &lt;code&gt;5dd&lt;/code&gt; etc.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fco3b6splg3lh6l1f3onc.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%2Fuploads%2Farticles%2Fco3b6splg3lh6l1f3onc.gif" alt="awesome"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  macros
&lt;/h2&gt;

&lt;p&gt;Vim supports keyboard macros. They let you record and replay your keystrokes. This is really great if you have some tedious typing to do.&lt;/p&gt;

&lt;p&gt;To start recording press &lt;code&gt;q&lt;/code&gt; followed by &lt;code&gt;a&lt;/code&gt;. To stop recording press the &lt;code&gt;ESC&lt;/code&gt; key. Then press &lt;code&gt;@&lt;/code&gt; followed by &lt;code&gt;a&lt;/code&gt; to replay the keystrokes.&lt;/p&gt;

&lt;p&gt;If you are new to vim, I recommend &lt;a href="https://vim.is" rel="noopener noreferrer"&gt;this course&lt;/a&gt;&lt;/p&gt;

</description>
      <category>vim</category>
      <category>linux</category>
    </item>
    <item>
      <title>Linux Command Line for Beginners</title>
      <dc:creator>Harvey</dc:creator>
      <pubDate>Tue, 25 May 2021 13:50:25 +0000</pubDate>
      <link>https://dev.to/harvey/linux-command-line-for-beginners-16n8</link>
      <guid>https://dev.to/harvey/linux-command-line-for-beginners-16n8</guid>
      <description>&lt;p&gt;The &lt;a href="https://www.linux.com/what-is-linux/"&gt;Linux&lt;/a&gt; command line is for power users. It is not for the faint of heart or for people who are afraid to take a risk. &lt;/p&gt;

&lt;p&gt;If you are new to Linux and are afraid to take the plunge into using the command line interface, then &lt;a href="//practicelinux.com/"&gt;this tutorial&lt;/a&gt; is a good start. &lt;/p&gt;

&lt;h2&gt;
  
  
  What is Linux and CLI? 💻
&lt;/h2&gt;

&lt;p&gt;Linux is an open source operating system that is used on everything from smart phones to main frame computers. &lt;/p&gt;

&lt;p&gt;Linux provides a command line interface (CLI) that provides a quick and powerful way to control and manipulate your computer. Once mastered, the Linux CLI can save you time and provide a powerful tool to aid in your daily tasks.&lt;/p&gt;

&lt;h2&gt;
  
  
  Commands
&lt;/h2&gt;

&lt;p&gt;The command line can be intimidating but learning the basics will give you access to a world of scripts and automation tools that will make your life a lot easier and more productive.&lt;/p&gt;

&lt;p&gt;The Basics: You will be using the command line to type various commands and tasks. Commands are what Linux runs. In Linux, the Command Line can be used for various things.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_tBU1EWp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xjwh38xzh6neufqr0hev.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_tBU1EWp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xjwh38xzh6neufqr0hev.gif" alt="cat enters pc"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To start, open up a terminal. Now, let's try using some basic Linux commands! &lt;/p&gt;

&lt;p&gt;Most of these commands are applicable for all Linux distributions. Linux is case sensitive (capitalization matters).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Navigation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ls&lt;/code&gt;    List directory&lt;br&gt;
&lt;code&gt;cd DIR&lt;/code&gt; Change the current directory to the DIR directory&lt;br&gt;
&lt;code&gt;cd ~&lt;/code&gt;  Change to home directory&lt;br&gt;
&lt;code&gt;cd /&lt;/code&gt;      Change the current directory to the root directory&lt;br&gt;
&lt;code&gt;cd ..&lt;/code&gt;     Go one directory lower&lt;br&gt;
&lt;code&gt;pwd&lt;/code&gt;   Show name of current working directory &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;File Commands&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mkdir -p DIR&lt;/code&gt; Create directory DIR &lt;br&gt;
&lt;code&gt;rm FILE&lt;/code&gt; Remove FILE&lt;br&gt;
&lt;code&gt;rm -r DIR&lt;/code&gt; Remove DIR and its contents recursively&lt;br&gt;
&lt;code&gt;rm -f FILE&lt;/code&gt; Force remove FILE &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;System Info&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;date&lt;/code&gt;  Print or set the system date and time&lt;br&gt;
&lt;code&gt;cal&lt;/code&gt;   Displays a calendar&lt;br&gt;
&lt;code&gt;uptime&lt;/code&gt; Tell how long the system has been running&lt;br&gt;
&lt;code&gt;w&lt;/code&gt;     Show who is logged on and what they are doing&lt;br&gt;
&lt;code&gt;whoami&lt;/code&gt;  Print effective userid &lt;/p&gt;

</description>
      <category>linux</category>
      <category>beginners</category>
    </item>
    <item>
      <title>A Quick Guide to the Vim Text Editor</title>
      <dc:creator>Harvey</dc:creator>
      <pubDate>Mon, 24 May 2021 10:10:12 +0000</pubDate>
      <link>https://dev.to/harvey/a-quick-guide-to-the-vim-text-editor-3e2b</link>
      <guid>https://dev.to/harvey/a-quick-guide-to-the-vim-text-editor-3e2b</guid>
      <description>&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Vim_(text_editor)" rel="noopener noreferrer"&gt;Vim&lt;/a&gt; is a  text editor which is highly efficient. It is an improved variant of the vi editor, that is distributed with &lt;a href="https://en.wikipedia.org/wiki/Unix" rel="noopener noreferrer"&gt;UNIX systems&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Vim is often called a "programmer's editor," and so useful for programming that many consider it an entire IDE. It's not just for programmers, though. Vim is perfect for all kinds of text editing, from composing email to editing configuration files.&lt;/p&gt;

&lt;p&gt;The vim text editor is an extremely powerful tool for developers, but it can be difficult to master.  If you are new to vim, I recommend &lt;a href="https://vim.is/" rel="noopener noreferrer"&gt;these exercises&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Install vim
&lt;/h2&gt;

&lt;p&gt;If you're using a Mac or a Linux machine, it's likely that your terminal has vim built in, so it's worth being familiar with to work on those systems. &lt;/p&gt;

&lt;p&gt;If not, you can install vim with your package manager or test if vi is installed.&lt;/p&gt;

&lt;p&gt;To install vim for Ubuntu, follow these instructions.&lt;/p&gt;

&lt;p&gt;1: Open a terminal window and type sudo apt-get install vim&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get install vim
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;2: If you want to get updated version of vim, open a terminal window and type sudo apt-get update&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;3: Then type sudo apt-get install vim&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get install vim
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The installation process will take some time, after which all the commands of vim will be available.&lt;/p&gt;

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

&lt;p&gt;To start vim, just type vim in the command line&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vim
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Then you can type &lt;code&gt;ESC&lt;/code&gt; followed by &lt;code&gt;:e filename&lt;/code&gt; to open filename.&lt;/p&gt;

&lt;p&gt;To open a vim directly from the command line, type:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vim filename
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Press &lt;code&gt;ZQ&lt;/code&gt; to quit vim without saving. Press &lt;code&gt;ZZ&lt;/code&gt; to save and exit.&lt;/p&gt;

&lt;p&gt;To move the cursor, you can press &lt;code&gt;ESC&lt;/code&gt; and use the keys &lt;code&gt;h&lt;/code&gt;,&lt;code&gt;j&lt;/code&gt;,&lt;code&gt;k&lt;/code&gt;,&lt;code&gt;l&lt;/code&gt;.  You can also use the arrow keys in vim.&lt;/p&gt;

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

&lt;p&gt;Vim has modes. To switch to writing mode, press the &lt;code&gt;i&lt;/code&gt; key or the &lt;code&gt;insert&lt;/code&gt; key. To switch to command mode, press the &lt;code&gt;ESC&lt;/code&gt; key.&lt;/p&gt;

&lt;p&gt;To save your file press &lt;code&gt;ESC&lt;/code&gt; followed by &lt;code&gt;:w&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Press &lt;code&gt;:Explore&lt;/code&gt; to open the file explorer. Use the &lt;code&gt;j&lt;/code&gt; and &lt;code&gt;k&lt;/code&gt; keys and press enter to open the file. You can also use &lt;code&gt;:LExplore&lt;/code&gt;&lt;/p&gt;


&lt;div class="ltag_asciinema"&gt;
  
&lt;/div&gt;



</description>
      <category>linux</category>
      <category>vim</category>
    </item>
    <item>
      <title>Why You Should Learn Vim</title>
      <dc:creator>Harvey</dc:creator>
      <pubDate>Sun, 23 May 2021 10:04:02 +0000</pubDate>
      <link>https://dev.to/harvey/why-you-should-learn-vim-41ph</link>
      <guid>https://dev.to/harvey/why-you-should-learn-vim-41ph</guid>
      <description>&lt;p&gt;Vim is the best text editor out there. I have been using it for almost a decade now and I’m not going back to Sublime Text or Atom or even Notepad. The fact that you can do all of your development work in the same tool that is also used to write your code is amazing.&lt;/p&gt;

&lt;p&gt;Vim is a powerful text editor with a lot of history and a certain aura of mystique around it. In this article, I'll try to dispel some of the myths around Vim and explain why you should learn to use it on the command line.&lt;/p&gt;

&lt;p&gt;Anyone who spends significant time in front of a terminal should consider learning to use vim.&lt;/p&gt;

&lt;h2&gt;
  
  
  It's everywhere 🆒
&lt;/h2&gt;

&lt;p&gt;First, why not learn to use Emacs or [insert favorite text editor here]? The two main reasons I like Vim are that it's ubiquitous and easy to use. Most server installations have Vim available. There's even a version included with Mac OS X.&lt;/p&gt;

&lt;p&gt;You can use it while coding, writing articles, notes, or even making spreadsheets. It can literally be everywhere you are! You can edit files through ssh! &lt;/p&gt;

&lt;h2&gt;
  
  
  Useful skill 💻
&lt;/h2&gt;

&lt;p&gt;Unlike the latest frontend framework or latest shiny language, vim always stays the same through the years. So it's good to learn vim.&lt;/p&gt;

&lt;p&gt;Vim has been the main editor used by most Linux users for at least 15 years, so you'll almost certainly find it on any server where you need to log in via SSH.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://vim.is/"&gt;Learn Vim&lt;/a&gt; by interactive exercises, no need to struggle with man pages or blogs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keyboard shortcuts for everything
&lt;/h2&gt;

&lt;p&gt;You can use the keys to navigate your code and vim. Press &lt;code&gt;gg&lt;/code&gt; to move to the top of the file, press &lt;code&gt;G&lt;/code&gt; to move to the end of the file, press &lt;code&gt;/&lt;/code&gt; to search etc.&lt;/p&gt;

&lt;p&gt;Once you know the shortcuts, it's a lot easier than grabbing your mouse and going to the menu bar, click edit, click find etc. It saves you a lot of time when coding.&lt;/p&gt;

&lt;h2&gt;
  
  
  Great for coding
&lt;/h2&gt;

&lt;p&gt;Any reasonably recent version of Vim has strong support for all kinds of programming languages, so it's great for editing source code.&lt;/p&gt;

&lt;p&gt;Vim supports all kinds of plugins and can be used even over an ssh connection to a sever. &lt;/p&gt;

&lt;p&gt;On top of that, you can use plugins like &lt;a href="https://github.com/ycm-core/YouCompleteMe"&gt;YouCompleteMe&lt;/a&gt; for code completion and &lt;a href="https://github.com/preservim/nerdtree"&gt;NerdTree&lt;/a&gt; for a file browser.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PMreLVyV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jeuajhzjf9dbpv65phaf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PMreLVyV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jeuajhzjf9dbpv65phaf.png" alt="vim syntax highlighting"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>vim</category>
      <category>linux</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Common Linux Commands for Newcomers</title>
      <dc:creator>Harvey</dc:creator>
      <pubDate>Fri, 21 May 2021 23:49:36 +0000</pubDate>
      <link>https://dev.to/harvey/common-linux-commands-for-newcomers-389l</link>
      <guid>https://dev.to/harvey/common-linux-commands-for-newcomers-389l</guid>
      <description>&lt;p&gt;While many &lt;a href="https://distrowatch.com/"&gt;Linux distributions&lt;/a&gt; (e.g., &lt;a href="https://ubuntu.com/"&gt;Ubuntu&lt;/a&gt;) include graphical interfaces, it can be useful—and fun—to learn how to navigate the command line.&lt;/p&gt;

&lt;p&gt;One of the questions I get from students most often is: what are some good commands to learn on Linux? &lt;/p&gt;

&lt;p&gt;It took me a long time to learn Linux commands (along with tmux, ssh, vim, pgp and many other programs). Now I would recommend learning the command line by &lt;a href="https://www.practicelinux.com/"&gt;exercise&lt;/a&gt; because that saves a lot of your time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Commands
&lt;/h2&gt;

&lt;p&gt;While there are many different answers to this question, here are some that I recommend to all new users.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;date&lt;/code&gt; - show the current date. Always good to know&lt;/p&gt;

&lt;p&gt;&lt;code&gt;pwd&lt;/code&gt; - When you're connected to a server via ssh and want to make sure you know exactly where you are, pwd (print working directory) lets you view the directory you are currently located in.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cd&lt;/code&gt; - change directory, files are organized into directories starting from the root &lt;code&gt;/&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ls&lt;/code&gt; - You're probably familiar with this command in other operating systems. Simply put, ls(short for list) is used to show the contents of a directory or if run at the command line, the contents of your current directory.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;./program&lt;/code&gt; - start program&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cat&lt;/code&gt; - displays the contents of a file.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZGj2XJ9---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pfhkwrppzzb4z80akdzb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZGj2XJ9---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pfhkwrppzzb4z80akdzb.png" alt="linux command line"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why command line?
&lt;/h2&gt;

&lt;p&gt;As a linux user, you may frequently use the command line to accomplish tasks. The command line lets you do things very quickly.&lt;/p&gt;

&lt;p&gt;Sometimes you might need to do something simple, like open a file in your text editor of choice. Learn &lt;a href="https://www.vim.org/"&gt;vim&lt;/a&gt; because it's a very powerful editor&lt;/p&gt;

&lt;p&gt;Other times, you might be crafting complex commands that automate a specific task. There are many &lt;a href="https://bsdnerds.org/what-is-linux-shell/"&gt;linux commands&lt;/a&gt;. &lt;/p&gt;

</description>
      <category>linux</category>
    </item>
  </channel>
</rss>
