
Ask HN: (2018) What are some of your favorite Unix command line aliases? - natch
By which I mean either aliases or short bash functions.<p>Examples:<p># download a video from YouTube or other major sites, recoding if needed into .mp4 format<p><pre><code>  alias yt=&#x27;youtube-dl --recode-video mp4&#x27;
</code></pre>
# empty the pasteboard (macOS only) [edit: fixed description]<p><pre><code>  alias pbclear=&#x27;echo &quot;&quot; | pbcopy&#x27;
</code></pre>
# remove formatting from text in pasteboard (macOS only)<p><pre><code>  alias pbclean=&#x27;pbpaste | pbcopy&#x27;
</code></pre>
# remove a directory even if it contains .DS_Store files (macOS specific)<p><pre><code>  function rmdir() {
      [[ -e &quot;$@&#x2F;.DS_Store&quot; ]] &amp;&amp; &#x2F;bin&#x2F;rm &quot;$@&#x2F;.DS_Store&quot;
      &#x2F;bin&#x2F;rmdir &quot;$@&quot;
  }
</code></pre>
# go to the &quot;Feeling Lucky&quot; result for a Google search<p><pre><code>  lucky () { open &quot;http:&#x2F;&#x2F;www.google.com&#x2F;search?hl=en&amp;q=`echo $* | sed &quot;s&#x2F; &#x2F;%20&#x2F;g&quot;`&amp;btnI&quot;; }</code></pre>
======
otras
While the git-completion.bash [0] function isn't short, this small addition to
my bashrc has made my life much easier:

    
    
      if [ -f ~/.git-completion.bash ]; then
            . ~/.git-completion.bash
      fi
    

[0]
[https://github.com/git/git/blob/master/contrib/completion/gi...](https://github.com/git/git/blob/master/contrib/completion/git-
completion.bash)

------
mathieubordere
some small ones I use.

alias x="xdg-open"

alias update="sudo apt-get update; sudo apt-get upgrade"

