Ask HN: Best things in your bash_profile/aliases?
I have a whole repository also including several dotfiles that I maintain for already several years [1].
Following are some snippets from the dotfiles&#x2F;.alias and dotfiles&#x2F;.functions files from that repository that probably are the most interesting and which I am using on a regular basis:<p><pre><code>    # easier navigation
    alias ..=&quot;cd ..&quot;
    alias ...=&quot;cd ..&#x2F;..&quot;
    alias ....=&quot;cd ..&#x2F;..&#x2F;..&quot;
    alias .....=&quot;cd ..&#x2F;..&#x2F;..&#x2F;..&quot;
    alias ~=&quot;cd ~&quot;

    # Get current public ip address
    alias ip=&quot;dig +short myip.opendns.com @resolver1.opendns.com&quot;

    # Alias for summing a column
    alias mksum=&quot;paste -sd+ - | bc&quot;

    # Export pbcopy &#x2F; pbpaste to linux 
    if [[ &quot;${OSTYPE}&quot; == &quot;linux&quot;* ]]; then
        alias pbcopy=&quot;xclip -selection clipboard&quot;
        alias pbpaste=&quot;xclip -selection clipboard -o&quot;
    fi

    # create a new directory and enter it
    function mkd() {
        mkdir -p &quot;$@&quot; &amp;&amp; cd &quot;$_&quot;;
    }

    # plot stuff directly from the command line.
    # Example: seq 100 | sed &#x27;s&#x2F;.*&#x2F;s(&amp;)&#x2F;&#x27; | bc -l | plot linecolor 2
    # -&gt; Generate 100 numbers, wrap it in s(&lt;num&gt;) and calc sin(&lt;num&gt;)
    function plot() {
        { echo &#x27;plot &quot;-&quot;&#x27; &quot;$@&quot;; cat; } | gnuplot -persist;
    }

    # wrapper for easy extraction of compressed files
    function extract () {
      if [ -f $1 ] ; then
          case $1 in
              *.tar.xz)    tar xvJf $1    ;;
              *.tar.bz2)   tar xvjf $1    ;;
              *.tar.gz)    tar xvzf $1    ;;
              *.bz2)       bunzip2 $1     ;;
              *.rar)       unrar e $1     ;;
              *.gz)        gunzip $1      ;;
              *.tar)       tar xvf $1     ;;
              *.tbz2)      tar xvjf $1    ;;
              *.tgz)       tar xvzf $1    ;;
              *.apk)       unzip $1       ;;
              *.epub)      unzip $1       ;;
              *.xpi)       unzip $1       ;;
              *.zip)       unzip $1       ;;
              *.war)       unzip $1       ;;
              *.jar)       unzip $1       ;;
              *.Z)         uncompress $1  ;;
              *.7z)        7z x $1        ;;
              *)           echo &quot;don&#x27;t know how to extract &#x27;$1&#x27;...&quot; ;;
          esac
      else
          echo &quot;&#x27;$1&#x27; is not a valid file!&quot;
      fi
    }
</code></pre>
[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;NewProggie&#x2F;Dev-Utils" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;NewProggie&#x2F;Dev-Utils</a>