
Ask HN: Share your favourite bash/zsh aliases - yanis_t
I&#x27;ll start by adding the most essential.<p>alias o=&quot;open&quot;<p>alias x=&quot;exit&quot;<p>alias g=&quot;git&quot;<p>alias gs=&#x27;git status&#x27;<p>alias gd=&#x27;git diff&#x27;<p>alias g-=&#x27;git checkout -&#x27;<p>alias serve=&#x27;python -m SimpleHTTPServer 8000&#x27;<p>alias mem=&#x27;top -l1 | grep PhysMem&#x27;
======
ubertaco
A function, not an alias, but I've found it useful when working on deeply-
nested projects/dirs:

    
    
        function up {
            if [[ "$#" < 1 ]] ; then
                cd ..
            else
                CDSTR=""
                for i in {1..$1} ; do
                    CDSTR="../$CDSTR"
                done
                cd $CDSTR
            fi
        }
    
    

I can just run "up" to "cd ..", or I can run "up 6" to "cd ../../../../../.."

------
mariocesar

      # Fast shortcuts
      alias c='clear'
      alias r='reset'
      alias q='exit'
    
      alias cd..="cd .." # I often make this mistake
    
      # Because sometimes you don't have the time to put this two letters
      alias ..='cd ..'
      alias ...='cd ../..'
      alias -- -="cd -"
    
      # Doing a fast proxy, good for watching netflix and youtube without restrictions
      alias proxy='ssh -C2qTnN -D 8080'
    
      # To search process with more details
      alias pp="ps axuf | pager"
    
      # Because I forget the name :(
      alias explore="ranger"
    
      # Because NeoVim is awesome :)
      alias vim=nvim
    
      # Do something and receive a desktop alert when it completes `sudo apt-get install something | alert`
      alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
    
      # Search process by name and highlight !
      function psgrep() { ps axuf | grep -v grep | grep "$@" -i --color=auto; }
    
      # Search for files and page it
      function search() { find . -iname "*$@*" | less; }

~~~
guh_me
You can enable AUTOCD and never have to type CD again. :)

shopt -s autocd

------
pdkl95

        # eXpand anything
        alias xx="atool -x"   
    

( [http://www.nongnu.org/atool/](http://www.nongnu.org/atool/) )

The incredible amount of time this has saved over the years is great, but the
real benefit never having remember either inspect archive files for the
initial directory or remember to do this dance:

    
    
        % mkdir foo
        % cd foo
        % tar zxvf /path/to/bar.tar.gz  # or "unzip foo.zip" or "7x x foo.7z" etc
        % mv bar-1.2.3 ..
        % cd ..
        % rmdir foo

~~~
Fannon
I have found this bash function a while ago. It doesn't save all the steps,
but it shouldn't be too difficult to add them, too.

[https://gist.github.com/Fannon/41b0a6104435943cd826](https://gist.github.com/Fannon/41b0a6104435943cd826)

~~~
pdkl95
I used to use something similar, but atool is _far_ superior. It handles quite
a few situations, but the most important is that it will decompress into the
current directory (as a normal "tar zxvf foo.tar.gz" or "unzip foo.zip") if-
and-only-if there was exactly one file or directory at the top level of the in
the archive. If the archive was packaged badly, it will leave the resulting
files in the temporary directory it creates. Also, atool leave the file(s) in
the temporary directory in the event of a name collision, so you protected
from the risk of clobbering existing files.

Without atool you have to either 1) create a temporary dir youself and do the
dance I showed above, or 2) always inspect every archive before you decompress
it to see if it has multiple top-level files, or 3) accept that typing "tar
xvf" or similar will sometimes spam your current directory (often $HOME) with
thousands of files.

Similar to how git tends to remove mental blocks around branching (you not
longer have ot worry about the cost of making an arbitrary change), atool
frees you from having to worry about how an archive was created. This has, in
practice, saved _huge_ amount of time and mental effort.

------
frnx
Here are a few I haven't seen in a lot of places but come in really handy.

First, alias this on Linux to get the 'open' command to work like OSX (e.g.
'open file.pdf'). It shadows a real 'open' command, but I have never used it,
so no big loss :

    
    
      alias open='xdg-open'
    

The second one I use all the time. A process that is stuck on I/O (or other
uninterruptible syscalls), or even a Python interpreter stuck in a C
extension, won't always respond well to Ctrl-C. However, Ctrl-Z (suspend) and
this alias (kills the last suspended process group) do work relatively well :

    
    
      alias killit='kill -9 %%'
    

This one I use a lot for copying the output of a command to the clipboard.
Just run 'command | pbcopy' and then Ctrl-V elsewhere. pbcopy is actually an
OSX command, I aliased it on Linux for ease of use :

    
    
      alias pbcopy='xclip -selection clipboard'
      alias pbpaste='xclip -selection clipboard -o'
    

This one runs a program under GDB. You can run e.g. 'gdbrun =python test.py'
and debug C extensions more easily:

    
    
      alias gdbrun='gdb -ex=r --args'

------
jcr
The essential and usual one handed listing aliases:

    
    
      alias l='ls -laFT'
      alias ll='ls -1aF'
      alias k='ls -laFTrt'
      alias kk='ls -1aFrt'
    

Some X + tee magic for logging.

    
    
      alias xlog='mv .xlog.txt .xlog.txt.old && startx -- -nolisten tcp 2>&1 | tee . xlog.txt > /dev/console'
    
      alias xdbg='mv .xdbg.txt .xdbg.txt.old && startx -- /usr/X11R6/bin/X -keepPriv 2>&1 | tee .xdbg.txt > /dev/console'
    

And in ~/.xinitrc run an oddly colored xterm with /dev/console output:

    
    
      xterm -C -fg '#b00020' -geometry 80x38+0+0 &
    

Most folks don't start X manually but when working on X itself, extra logging
can often help.

------
vtempest
Install useful .bashrc shortcuts: u check updates, l detailed file list, ..
parent dir, i [appname] install package, x [file] uncompress file, own [dir]
get access to folder, p [procname] find process by name, f [string] find
string in this folder's files, gg git commit and push

sed -i "$ a\\#custom shortcuts \nx(){ case \$1 in _.tar.bz2) tar xjf
\$1;;_.tar.gz) tar xzf \$1;; _.bz2) bunzip2 \$1;;_.rar) rar x \$1;; _.gz)
gunzip \$1;;_.tar) tar xf \$1;; _.tbz2) tar xjf \$1;;_.tgz) tar xzf \$1;;
_.zip) unzip \$1;;_.Z) uncompress \$1;; esac; } \nf(){ grep -R -I \"\$1\" ./*;
} \np(){ ps aux | grep \$1 | grep -v grep; } \nown(){ sudo chmod 777 -R
\${1:-.} && sudo chown -R \${USER} \${1:-.}; } \nalias u='sudo apt-get update
&& sudo apt-get dist-upgrade -y && sudo apt-get autoremove -y' \nalias l='ls
-la' \nalias ..='cd ..' \nalias i='sudo apt-get install -y ' \nalias gg='git
add . && git commit -a -m "." && git push -u -f origin master'" ~/.bashrc &&
source ~/.bashrc

More here [https://github.com/gulakov/nodejs-
starter/blob/master/README...](https://github.com/gulakov/nodejs-
starter/blob/master/README.md)

------
danwakefield
I use most of the oh-my-zsh builtins. The git ones save a ton of time and
G='|grep' is brilliant.

    
    
        alias GD='git diff HEAD~1 HEAD'
        alias grv='git review'
        alias gunmod='git status | grep "modified" | awk "{print \$2}" | xargs -I{} git checkout -- {}'
        alias gv='gvim --remote-silent'
        alias json='| python -m json.tool'
        alias vg='vagrant'
        alias ans='ansible '
        alias ansp='ansible-playbook '
        alias vv='virtualenv venv'
        alias vvp='venv/bin/python'
        alias vvpi='venv/bin/python setup.py develop'
        alias yt='cd $HOME/downloads; youtube-dl --verbose'
        alias yt3='cd $HOME/downloads; youtube-dl --verbose --extract-audio --audio-format mp3 '
    

I keep all of my shell history, right now it think it goes back ~3 years, so
every now and then I filter it by frequency and check if I am using a command
often enough to justify an alias. Works quite well

~~~
egwynn

      > alias json='| python -m json.tool'
    

Is the beginning pipe intended? If I just run 'python -m json.tool' then it
starts reading from stdin by itself (and works as intended). And with the
pipe, I can’t seem to make the alias work.

    
    
      $ echo  '{ "foo": 1234}' | json
      -bash: syntax error near unexpected token `|'
    
      $ json
      -bash: syntax error near unexpected token `|'

~~~
danwakefield
yeah, thats my bad, A recent addition and I must have copied too much of the
command line when adding it.

------
halisaurus
Assuming functions count:

    
    
        # git branch ahead/behind another
        function gahead() {
          # use first argument or master
          original=${1-master}
    
          # use the second argument or current branch if not given
          current=`git branch | grep \* | sed s/\*\ //`
          compare=${2-$current}
    
          # run git rev-list and capture numbers returned
          result=`git rev-list --left-right --count $original...$compare`
    
          # print numbers in a pretty message
          numbers=($result);
          echo -e "$Red-$Color_Off $compare is currently $IRed${numbers[0]}$Color_Off commits behind $original";
          echo -e "$Green+$Color_Off $compare is currently $IGreen${numbers[1]}$Color_Off commits ahead of $original";
        }
    

Edit: if it's not clear you would use this like:

    
    
        $ gahead #checks current branch against master
        $ gahead development #checks current branch against development
        $ gahead development foo #checks foo branch against development
    

NB: this is checking local branches, not remote branches.

------
ajdlinux
Starting a (generally GUI) application in the background and detaching it as
much as possible from the current terminal, so it doesn't quit on a SIGHUP. I
have this as a bash script (~/bin/bgrun), but it could pretty easily become an
alias or function:

    
    
        #!/bin/bash
        nohup "$@" > /dev/null 2>&1 < /dev/null &

~~~
anotherevan
I have the same script, calling it nnohup in my ~/bin folder.

Common GUI programs I often launch from the command line I put an alias in my
.bashrc for. e.g.

    
    
      alias thg="~/bin/nnohup /usr/bin/thg"
      alias rabbitvcs="~/bin/nnohup /usr/bin/rabbitvcs"
      alias meld="~/bin/nnohup /usr/bin/meld"
      alias xnview="~/bin/nnohup /usr/bin/xnview"
      alias dolphin="~/bin/nnohup /usr/bin/dolphin"
      alias vlc="~/bin/nnohup /usr/bin/vlc"

------
1hackaday

      alias ..='cd ..'
      alias ...='cd ../..'
      alias ....='cd ../../..'
      alias .....='cd ../../../..'
      alias ......='cd ../../../../..'
       
      # search history (??) and processes (???)
      alias '?=fc -li 1'
      alias '??=fc -li 1 | grep '
      alias '???=ps-grep'
       
      alias m='less'
       
      alias su='sudo -H -s'
       
      # move to trash rather than deleting
      rm='trash-put -v'
       
      # simplify hard to remember command names
      alias pk-show='apt-cache show'
      alias pk-install='sudo apt-get install'
      alias pk-update='sudo apt-get update'
      alias pk-update-upgrade='sudo apt-get update && sudo apt-get upgrade'
      alias pk-uu=pk-update-upgrade
      alias pk-remove='sudo apt-get remove'
      alias pk-debinst='sudo dpkg -i'
      pk-search () {
        apt-cache search $1 | sort | egrep "${1}|$"
      }

------
groks
(Use ^d instead of aliasing x to exit)

Use magit in emacs as a git front-end instead of dozens of git aliases. You
can continue to use vi or eclipse or whatever for editing. Use dired in emacs
to replace a lot of file manipulation aliases.

Replace all your complicated aliases with ^r reverse search. For example,
instead of typing

    
    
        sudo dnf --refresh check-update
    

I type

    
    
        ^rche
    

because 'check' is the most distinct string in that command in my mind, and by
'che' bash has already located the last time I typed it in the history. Save
lots of history:

    
    
        HISTSIZE=100000                   # Lots of history.
        HISTFILESIZE=100000               # Lots of history in the file.
        HISTCONTROL=ignoreboth            # Ignore entries with leading white space and dupes.
        HISTIGNORE="ls:ll:cd:fg:j:jobs"   # Uninteresting commands to not record in history.
        shopt -s histappend               # Append history to file, don't overwrite.
        shopt -s histverify               # Show expanded history before running it.
        shopt -s cmdhist                  # Store multiline cmds as single
    

Which directory is hiding all the bytes?

    
    
        alias dux='du -x --max-depth=1 | sort -n'
    

Machines on the local network:

    
    
        alias nwho='ping -b -c 2 255.255.255.255 2>&1 | grep "bytes from" | cut -d " " -f 4 | sort | uniq | sed -e "s/://g"'
    

Set the permissions to allow sharing of files in a directory between users in
the same group (probably doesn't work on bsd/osx):

    
    
        function rwxs {
            find $1 -type d | xargs chmod u+rwx,g+rwxs,o+rx
            find $1 -type f | xargs chmod ug+rw,o+r
        }

------
jetpm
I made a bash function for easier alias binding. It makes aliases immediately
available and permanent. Also you don't need quotes so you can use tab
completion etc. It goes like this:

ali <name of alias> <command>

to get it put this in your .bashrc

    
    
      function ali() {  
       echo "alias $1='${@:2}'" >> ~/.bashrc   #in ubuntu use   ~/.bash_aliases  
       echo "made alias:";  
       echo "alias $1='${@:2}'";  
       source ~/.bashrc;  #reload bashrc  
      }
    
    

When I realize I type a command often, I just push the up arrow to get the
command again, append "ali" infront of it and turn it to an alias. Works
direclty.

And of course the alias to show the list of all aliases:

    
    
      alias alis='cat ~/.bash_aliases'

~~~
a3n
> alias alis='cat ~/.bash_aliases'

That only lists what's in .bash_aliases, along with any comments.

Why not just run _alias_ without arguments? It lists all active aliases,
however and whenever they were defined.

    
    
      $ man bash
      /^SHELL BUILTIN COMMANDS
      ...
      alias [-p] [name[=value] ...]
    

"Alias with no arguments or with the -p option prints the list of aliases in
the form alias name=value on standard output."

------
rey12rey
I use a lot of oh-my-zsh's git aliases and a couple others but here are the
ones I've used the most over time and some

alias _=sudo

alias aria='aria2c --file-allocation=none -c -x 10'

alias aria_list='aria2c --file-allocation=none --force-sequential=true -c -x
10 -i'

alias d='dirs -v | head -10'

alias hdmi='xrandr --output HDMI1 --auto --right-of LVDS1'

alias history='fc -l 1'

alias la='ls -lAh'

alias lock='i3lock -c #1E90FF'

alias ls='ls --color=tty'

alias md='mkdir -p'

alias pyfind='find . -name " _.py "'

alias pygrep='grep --include="_.py"'

alias rd=rmdir

alias reload_sound='pulseaudio -k && sudo alsa force-reload' # when sound
messes up

alias settings=gnome-control-center

alias sl=ls

alias utorrent='utserver -settingspath /opt/utorrent-server-alpha-v3_3/ &'

alias vga='xrandr --output VGA1 --auto --right-of LVDS1'

alias vga_same='xrandr --output VGA1 --auto --same-as LVDS1'

------
zimmund
Simple Vagrant aliases:

    
    
      alias vup='vagrant up'
      alias vdn='vagrant halt'
      alias sv='ssh vagrant'
    

Some apt-get ones:

    
    
      alias sapu='sudo apt-get update'
      alias sapi='sudo apt-get install'
      alias sapr='sudo apt-get remove'
    

When I'm in Windows I use __Cygwin __(as a dropdown terminal[1]), these are
useful:

    
    
      alias tk='taskkill -f -im'
      alias ping='PING'
      alias flush='ipconfig /flushdns'
    
    

[1]: [http://blog.elamperti.com/2014/11/dropdown-cygwin-
terminal-i...](http://blog.elamperti.com/2014/11/dropdown-cygwin-terminal-in-
windows-7/)

------
nathan_f77
Check out SCM Breeze [1] if you are interested in git aliases.

[1]:
[https://github.com/ndbroadbent/scm_breeze](https://github.com/ndbroadbent/scm_breeze)

------
egwynn

      alias sucs='sort | uniq -c | sort -n’ # Makes a histogram of line-based input
      
      # Example
      $ echo c c c c b c b a a a | xargs -n1 | sucs
       2 b
       3 a
       5 c

------
anotherevan
Quick mv -i and cp -i aliases:

    
    
      alias mvi="mv -i"
      alias cpi="cp -i"
    

Truncate a file to empty:

    
    
      alias zeroout="truncate -s 0"

------
nemild
Have you taken a look at the top dotfiles on Github (
[https://dotfiles.github.io/](https://dotfiles.github.io/) )? They have a
pretty good set of aliases, especially the basics and many for git.

For example, YADR is pretty good (
[https://github.com/skwp/dotfiles](https://github.com/skwp/dotfiles) ).

Of the ones not listed already in this thread, a few standards that are great
to have:

L - less

H - | head

T - | tail

G - | grep

C - | wc -l

N - /dev/null

S - | sort

_ - sudo

~~~
erikb
the dotfiles site seems a good idea but for some reason I'm basically unable
to read the text. Even highlighting some with the mouse doesn't help.

------
binaryghost
#make intermediate directories and touch a file all at once

#e.g. mktouch ~/Desktop/test/file.md would make the test dir if it didn't
exist then touch file.md inside of it

mktouch() {

    
    
        if [ $# -lt 1 ]; then
            echo "Missing argument";
            return 1;
        fi
    
        for f in "$@"; do
            mkdir -p -- "$(dirname -- "$f")"
            touch -- "$f"
        done
    }

------
orkj
This is my favorite because it is so pleasing:

alias ffs=sudo

example usage:

    
    
      $ grep 'something' some.conf
      grep: some.conf: Permission denied
      $ ffs !!
      Password:`

~~~
laxk
I'm using please alias. You don't need even use !!. alias pls='sudo `fc -n -l
-1`'

------
nness
If you're a virtualenv user, I use this one-liner to start load a virtualenv
named after the current directory:

    
    
        alias v='workon "${PWD##*/}"'
    

Also, I really like the -p flag of mkdir (creating child directories as
needed, without failing if one doesn't exist)

    
    
        alias mkdir='mkdir -p'
        # i.e. mkdir ./a/b/c/

------
0942v8653
I don't have many. Tab completion on linux is usually enough.

    
    
        alias i='i3-msg -q exec --'
        alias jql='jq . -C | less -R'
    

Also bindings:

    
    
        bind -m vi-command -x '"\C-n": new-term-here'
        bind -m vi-insert  -x '"\C-n": new-term-here'
    
        #which is `i gnome-terminal --working-directory="$PWD"`

------
poltak
My most used aliases would probably have to be for the git commands. Each git
command, I have aliased to the name of the command, preceded with the letter
'g'. So:

    
    
      alias gadd='git add'
    

and so on.

I find the oh-my-zsh git plugin's default aliases to be unintuitive and hard
to remember. Simply not having to type 'git ' before everything is good enough
for me.

------
namecast

        alias c='noglob perl -e '\''shift; $x = eval qq(@ARGV); print $x; printf " 0x%x 0%o %b\n", $x, $x, $x'\'' _' ' "'
    

Quick and easy perl calculator, with octal, decimal and hex output. Example
usage:

    
    
        root:~$ c 365 * 24 * 6 / (14 +2)
        3285 0xcd5 06325 110011010101

------
kenrose
On Mac OS, copy the CWD to the clipboard:

alias cpcd="echo -ne \$(pwd) | pbcopy"

Useful when you have a file picker in front of you, but you know you have a
terminal already in the directory you want. Switch to the term, cpcd, switch
to the file picker, Go to folder (⌘-Shift-G), Paste (⌘-V).

when you have a terminal open in a directory, but another app has a file
picker box.

~~~
nemild
Why not just do 'open .' in Terminal/iTerm 2?

------
DeBraid
Pretty git log:

    
    
        alias gl="git log -n 15 --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
    

Copy current working dir (OSX), very handy.

    
    
        alias cpwd='pwd | pbcopy'

------
uberspot
I love some of the aliases here. :D Added them to my toolbelt. Here are mine.

[https://github.com/uberspot/dotfiles/blob/master/.alias](https://github.com/uberspot/dotfiles/blob/master/.alias)

------
andreastt
By far my favourite is

    
    
        alias sl ls
    

[https://github.com/andreastt/dotfiles/blob/master/login#L44](https://github.com/andreastt/dotfiles/blob/master/login#L44)

~~~
groks

        sudo dnf install sl

------
arh68

      l() { tree -L 1 -CDFha --du --dirsfirst $@; }
      ll() { l -L 2 $@; }
      lll() { l -L 3 $@; }
      md() { open -F -a /Applications/Marked\ 2.app/ $@; }
      st() { open -F -a /Applications/Sublime\ Text\ 2.app/ $@; }

------
myhf

        # quick sketching
        alias ep='emacs -eval "(picture-mode)"'
        
        # quick timer
        alias timer="time read -sn1"
        
        # quick look
        alias ql='qlmanage -p 2>/dev/null'

------
noselasd

        alias lc="ls -C | less"
    
        alias ll="ls -lh"
    
        function mkd() {
            if [[ $#  == 0 ]] ; then
                return
            fi
    
            mkdir "$1"
            cd "$1"
        }

------
reinhardt
# trim off trailing spaces

    
    
        alias rstrip='sed -i "s/[ \t]*$//"'
    

# delete .pyc files

    
    
       alias delpyc='find . -type f -name "*.pyc" -delete'

------
betacar

      alias ga="git add ."
    
      alias gs="git stash"
    
      alias gas="ga && gs"
    
      alias gmm="git merge master"
    
      alias grm="git rebase master"

------
arxpoetica
Quickly get my ip:

    
    
        alias myip="ifconfig | grep 'inet ' | grep -v 127.0.0.1 | cut -d\   -f2"

~~~
colindean
I frequently have my machines connected via multiple interfaces. I put
together a little simple C program that can be run as a script.

[https://github.com/colindean/getip](https://github.com/colindean/getip)

I've not actually used it as a script in a while, and it appears to be broken
in that regard at the moment (something about ld not being able to write to
the tmp directory). However, its Makefile is still operational. Maybe someone
will see this and submit a PR that fixes it?

------
namtrac
alias scp='rsync --archive --compress-level=3 --copy-links --partial --inplace
--progress --rsh=ssh -r'

~~~
halisaurus
But now you can't use scp, right? Or did you alias that too?

~~~
runejuhl
Just prepend the command with `\\`, that disables aliases.

------
notinventedhear
My best time-savers:

alias ff="find . -iname"

alias size="du -h --max-depth=1"

alias latest="ls -lt |head"

alias orly='sudo $(history -p \\!\\!)'

------
edoceo
Use .ssh/config to shorten all hostnames a set specific key combinations.

    
    
        ssh h.e.c

------
a3n

      alias l='ls -1F'

------
Fannon
alias ip="curl icanhazip.com" # Your public IP address

alias diskspace="du -S | sort -n -r |less"

alias pyserver='python -m SimpleHTTPServer'

alias phpserver='php -S localhost:8000'

alias phplog='tail -f /var/log/apache2/error.log'

------
d99kris

      alias hn='elinks http://news.ycombinator.com/news'

------
veddox
alias todo='grep "FIXME" * ; grep "TODO" * ; grep "XXX" *'

Shows up all the things I still need to work on in a given project (assuming
of course that you annotate your code...).

------
lukasm
I use oh-my-zsh aliases

    
    
        ...=../..
    	....=../../..
    	.....=../../../..
    	......=../../../../..
    	1='cd -'
    	2='cd -2'
    	3='cd -3'
    	4='cd -4'
    	5='cd -5'
    	6='cd -6'
    	7='cd -7'
    	8='cd -8'
    	9='cd -9'
    	_=sudo
    	afind='ack-grep -il'
    	d='dirs -v | head -10'
    	g=git
    	ga='git add'
    	gaa='git add --all'
    	gap='git add --patch'
    	gb='git branch'
    	gba='git branch -a'
    	gbr='git branch --remote'
    	gc='git commit -v'
    	'gc!'='git commit -v --amend'
    	gca='git commit -v -a'
    	'gca!'='git commit -v -a --amend'
    	gcl='git config --list'
    	gclean='git reset --hard && git clean -dfx'
    	gcm='git checkout master'
    	gcmsg='git commit -m'
    	gco='git checkout'
    	gcount='git shortlog -sn'
    	gcp='git cherry-pick'
    	gcs='git commit -S'
    	gd='git diff'
    	gdc='git diff --cached'
    	gdt='git difftool'
    	gg='git gui citool'
    	gga='git gui citool --amend'
    	ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)'
    	ggpull='git pull origin $(current_branch)'
    	ggpur='git pull --rebase origin $(current_branch)'
    	ggpush='git push origin $(current_branch)'
    	gignore='git update-index --assume-unchanged'
    	gignored='git ls-files -v | grep "^[[:lower:]]"'
    	git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
    	gk='gitk --all --branches'
    	gl='git pull'
    	glg='git log --stat --max-count=10'
    	glgg='git log --graph --max-count=10'
    	glgga='git log --graph --decorate --all'
    	glo='git log --oneline --decorate --color'
    	globurl='noglob urlglobber '
    	glog='git log --oneline --decorate --color --graph'
    	glp=_git_log_prettily
    	gm='git merge'
    	gmt='git mergetool --no-prompt'
    	gp='git push'
    	gpoat='git push origin --all && git push origin --tags'
    	gr='git remote'
    	grba='git rebase --abort'
    	grbc='git rebase --continue'
    	grbi='git rebase -i'
    	grep='grep  --color=auto --exclude-dir={.bzr,.cvs,.git,.hg,.svn}'
    	grh='git reset HEAD'
    	grhh='git reset HEAD --hard'
    	grmv='git remote rename'
    	grrm='git remote remove'
    	grset='git remote set-url'
    	grt='cd $(git rev-parse --show-toplevel || echo ".")'
    	grup='git remote update'
    	grv='git remote -v'
    	gsd='git svn dcommit'
    	gsps='git show --pretty=short --show-signature'
    	gsr='git svn rebase'
    	gss='git status -s'
    	gst='git status'
    	gsta='git stash'
    	gstd='git stash drop'
    	gstp='git stash pop'
    	gsts='git stash show --text'
    	gts='git tag -s'
    	gunignore='git update-index --no-assume-unchanged'
    	gunwip='git log -n 1 | grep -q -c "\-\-wip\-\-" && git reset HEAD~1'
    	gup='git pull --rebase'
    	gvt='git verify-tag'
    	gwc='git whatchanged -p --abbrev-commit --pretty=medium'
    	gwip='git add -A; git ls-files --deleted -z | xargs -r0 git rm; git commit -m "--wip--"'
    	history='fc -l 1'
    	l='ls -lah'
    	la='ls -lAh'
    	ll='ls -lh'
    	ls='ls -G'
    	lsa='ls -lah'
    	md='mkdir -p'
    	please=sudo
    	po=popd
    	pu=pushd
    	rd=rmdir
    	run-help=man
    	which-command=whence

~~~
CJefferson
Do these really save that much time?

I stopped using oh-my-zsh because of these. There is a popular program called
'gap' which got over-written by one of these aliases.

~~~
gluelogic
I am hooked on most of them at this point, but I can see that being very
annoying.

------
a_bonobo
alias cp='cp -i'

prompts when you overwrite something using cp ("oops, wrong folder")

alias rm='rm -I'

prompts when you delete more than three files ("oops, a space too much in rm
./ *")

------
calyhre

      alias nope="git commit -m 'ಠ_ಠ'"

------
sebastianmarkow
chsh -s /bin/fish

[https://github.com/fish-shell/fish-shell](https://github.com/fish-shell/fish-
shell)

------
yanis_t
Create and cd into mkcd() { mkdir $@ && cd $_ }

------
tarrsalah
My favorite one is: alias fuck='pkill -9'

------
fourier
alias e='emacsclient'

alias serv="ssh mylogin@myserv.com"

alias work="cd /Users/myname/Sources/mycompany/myproject"

------
giuscri
alias ":q"="exit"

------
namuol

        alias ..='cd ..'

------
olalonde

      alias dc=docker-compose

------
atsaloli
alias s=ssh

------
fortytw2
has always served me well - `alias yolo='git rm -f * && git commit -am "yolo"
&& git push -f origin master'`

