<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Shell on Monte&#39;s Snippets</title>
    <link>https://montepy.in/tags/shell/</link>
    <description>Recent content in Shell on Monte&#39;s Snippets</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Mon, 01 Apr 2024 22:43:39 +0530</lastBuildDate>
    <atom:link href="https://montepy.in/tags/shell/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>How to parse json in terminal using jq</title>
      <link>https://montepy.in/posts/jq/</link>
      <pubDate>Mon, 01 Apr 2024 22:43:39 +0530</pubDate>
      <guid>https://montepy.in/posts/jq/</guid>
      <description>&lt;h2 id=&#34;a-practical-tutorial-on-jq&#34;&gt;A practical tutorial on &lt;code&gt;jq&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;So here&amp;rsquo;s the problem statement: &lt;em&gt;&lt;strong&gt;Find the repository on github in which you have made most number of commits? And you need to do this on terminal (no python)&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Ofcourse, one can use python to find the answer, and it might be probably easy for you, if you have been using python for last many years. But let&amp;rsquo;s see if I can do this in terminal with &lt;code&gt;jq&lt;/code&gt; and while doing so, let&amp;rsquo;s learn about it.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to `find` files in terminal?</title>
      <link>https://montepy.in/posts/find/</link>
      <pubDate>Wed, 21 Feb 2024 20:26:20 +0530</pubDate>
      <guid>https://montepy.in/posts/find/</guid>
      <description>&lt;p&gt;&lt;em&gt;&lt;strong&gt;Manager&lt;/strong&gt;&lt;/em&gt;: Hey, I need your help, I have couple of images that are taking a lot of space on my PC, I want to delete them. How can I do that?&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;Developer&lt;/strong&gt;&lt;/em&gt;: Well that should be simple. Here, you go. This looks for all files with &lt;code&gt;.png&lt;/code&gt; extension in the current directory and its subdirectories (using &lt;code&gt;-R&lt;/code&gt; flag), then pipes those file names to &lt;code&gt;rm&lt;/code&gt; command to delete them.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;ls -R &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; grep &lt;span class=&#34;s2&#34;&gt;&amp;#34;.png&lt;/span&gt;$&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; xargs rm
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;em&gt;&lt;strong&gt;Manager&lt;/strong&gt;&lt;/em&gt;: Nice, but wait. This will delete all the &lt;code&gt;png&lt;/code&gt; files in the current directory and its subdirectories. I only want to delete in specific directories.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
