Skip to content

Instantly share code, notes, and snippets.

@jpluimers
Last active August 29, 2015 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpluimers/4c29484fdda0369d05f8 to your computer and use it in GitHub Desktop.
Save jpluimers/4c29484fdda0369d05f8 to your computer and use it in GitHub Desktop.
bash aliases for Cygwin and Mac
# New user-defined bash aliases file
# Is executed from a modified .bashrc file
# .bashrc is executed from .bash_profile on cygwin
# on other systems, see http://www.joshstaiger.org/archives/2005/07/bash_profile_vs.html
## This is the portion in .bashrc you need to edit in cygwin to enable .bash_aliases:
## Aliases
##
## Some people use a different file for aliases
## if [ -f "${HOME}/.bash_aliases" ]; then
## source "${HOME}/.bash_aliases"
## fi
alias ls-8601='ls -l -T'
alias ls-full-8601='ls -l --time-style=full-iso'
# octal file modes through http://stackoverflow.com/questions/1795976/can-the-unix-list-command-ls-output-numerical-chmod-permissions
alias lsmod='ls -al|awk '\''{k=0;s=0;for(i=0;i<=8;i++){;k+=((substr($1,i+2,1)~/[rwxst]/)*2^(8-i));};j=4;for(i=4;i<=10;i+=3){;s+=((substr($1,i,1)~/[stST]/)*j);j/=2;};if(k){;printf("%0o%0o ",s,k);};print;}'\'''
# silence the progress meter on Cygwin with -sS via http://stackoverflow.com/questions/7373752/how-do-i-get-curl-to-not-show-the-progress-bar
alias whatismyip='curl -sS http://whatismyip.akamai.com && echo'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment