Skip to content

Instantly share code, notes, and snippets.

@nitrocode
Last active June 16, 2016 20:17
Show Gist options
  • Select an option

  • Save nitrocode/bf85b112835c7185ec33 to your computer and use it in GitHub Desktop.

Select an option

Save nitrocode/bf85b112835c7185ec33 to your computer and use it in GitHub Desktop.
Eventually will contain all my favorite and useful aliases
#!/bin/bash
# Work in progress
# A lot of aliases are already covered by ohmyzsh
# ls aliases
## shows ls in color, shows directories prefixed with a /, and shows directories first
alias ls='ls -F --color=auto --group-directories-first'
## Use a long listing format ##
alias ll='ls -la'
## Show hidden files ##
alias l.='ls -d .* --color=auto'
# grep aliases
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
## for ipython
alias py='ipython'
alias h="history"
## get rid of command not found ##
alias cd..='cd ..'
## a quick way to get out of current directory ##
alias ..='cd ..'
alias ...='cd ../../../'
alias ....='cd ../../../../'
alias .....='cd ../../../../'
# start incomplete downloads from the point it stopped downloading
alias wget="wget -c"
# etc
# source: http://unix.stackexchange.com/a/159254
# will decode or encode urls
alias urlencode='python -c "import sys, urllib as ul; \
print ul.quote_plus(sys.argv[1])"'
alias urldecode='python -c "import sys, urllib as ul; \
print ul.unquote_plus(sys.argv[1])"'
# editors
alias vi="vim"
# alias for nano to turn tabs into 4 spaces
alias nano="nano -ET4"
######### CYGWIN / CONEMU ONLY / WINDOWS #########
# clear scrollback in cygwin / conemu
alias cls='printf "\033c"'
# windows kill task using PID
alias wkill="taskkill /F /PID"
# windows kill task using process name
function wkillall {
tasklist | grep $1 | awk '{print $2;}' | while read f; do wkill $f; done;
}
# windows get pid of process using port
function wfindport {
netstat -ano | grep -E 'Proto|$1'
}
# open wordpad from commandline
alias wordpad="/cygdrive/c/Program\ Files\ \(x86\)/Windows\ NT/Accessories/wordpad.exe"
## for systems (cygwin, centos, etc) that do not have pdb mapped
alias pdb='python -m pdb'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment