13 lines
1.4 KiB
HTML
13 lines
1.4 KiB
HTML
<article>
|
|
<header id="title-block-header">
|
|
<h1 class="title">Re: My Top 10 Linux Commands</h1>
|
|
<p class="date">2024-08-31 00:00:00 -08:00</p>
|
|
</header>
|
|
<p>I came across <a href="https://www.garron.blog/notes/my-top-10-linux-commands.html">this post</a> by Guillermo Garron sharing how to see your most used shell commands. The post says “Linux Commands”, but this will work with any POSIX or POSIX adjacent shell. Just run the following command:</p>
|
|
<pre class="shell"><code>history | awk '{print $2}' | sort | uniq -c | sort -nr | head -n 10</code></pre>
|
|
<p>I thought it would be fun and silly to share my results, which were:</p>
|
|
<pre class="shell"><code>1 history</code></pre>
|
|
<p>The reason why there is only this one command in my top 10 list of most used commands is because I don’t keep that history. My <code>$HISTFILE</code> is set to <code>/dev/null</code>, which helps keep my home folder clean of unnecessary files, and I believe that history is unnecessary. I keep a lot of notes for commands that I need to refer back to later, or I create shell scripts for commands that need to be repeatedly ran. This practice works for me because I feel like I am always starting with a clean slate, while still being able to quickly look up what I need to do with man-pages, my personal notes, or shell scripts.</p>
|
|
<p>Give it a try, delete your history!</p>
|
|
</article>
|