daily pastebin goal
47%
SHARE
TWEET

Untitled

a guest Nov 24th, 2017 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. alias please='sudo $(history -p !!)'
  2.  
  3. alias accio='sudo apt-get install'
  4.  
  5. alias alohomora='chmod 777'
  6.  
  7. alias setclip="xclip -selection c"
  8. alias getclip="xclip -selection c -o"
  9.  
  10. alias ls="ls --color=auto"
  11.  
  12. alias lsh='ls -lhXG' # long listing, human-readable, sort by extension, do n$
  13.  
  14. alias downloads="cd ~/Downloads"
  15.  
  16. alias documents="cd ~/Documents"
  17.  
  18. ## get rid of command not found ##
  19. alias cd..='cd ..'
  20.  
  21. ## a quick way to get out of current directory ##
  22. alias ..='cd ..'
  23. alias ...='cd ../../../'
  24. alias ....='cd ../../../../'
  25. alias .....='cd ../../../../'
  26. alias .4='cd ../../../../'
  27. alias .5='cd ../../../../..'
  28.  
  29.  
  30. function up( )
  31. {
  32. LIMIT=$1
  33. P=$PWD
  34. for ((i=1; i <= LIMIT; i++))
  35. do
  36.     P=$P/..
  37. done
  38. cd $P
  39. export MPWD=$P
  40. }
  41.  
  42. source ~/Documents/programs/bashmarks/bashmarks.sh
  43.  
  44.  
  45. alias grep="grep --color=auto"
  46.  
  47. alias gc='git commit -m'
  48. alias gca='git add -A; git commit -m'
  49. alias gpm='git push origin master'
  50. alias gp='git push origin'
  51.  
  52. alias gitc='git ls-files | xargs wc -l'
  53. alias gitcj='git ls-files | grep "\.java$" | xargs wc -l'
  54.  
  55.  
  56. alias ports='netstat -tulanp'
  57.  
  58. alias ip="curl icanhazip.com"
  59.  
  60. function cls() { cd "$1"; ls;}
  61.  
  62. function md5check() { md5sum "$1" | grep "$2";}
  63.  
  64. function extract {
  65.  if [ -z "$1" ]; then
  66.     # display usage if no parameters given
  67.     echo "Usage: extract <path/file_name>.<zip|rar|bz2|gz|tar|tbz2|tgz|Z|7z|xz|ex|tar.bz2|tar.gz|tar.xz>"
  68.     echo "       extract <path/file_name_1.ext> [path/file_name_2.ext] [path/file_name_3.ext]"
  69.     return 1
  70.  else
  71.     for n in $@
  72.     do
  73.       if [ -f "$n" ] ; then
  74.           case "${n%,}" in
  75.             *.tar.bz2|*.tar.gz|*.tar.xz|*.tbz2|*.tgz|*.txz|*.tar)
  76.                          tar xvf "$n"       ;;
  77.             *.lzma)      unlzma ./"$n"      ;;
  78.             *.bz2)       bunzip2 ./"$n"     ;;
  79.             *.rar)       unrar x -ad ./"$n" ;;
  80.             *.gz)        gunzip ./"$n"      ;;
  81.             *.zip)       unzip ./"$n"       ;;
  82.             *.z)         uncompress ./"$n"  ;;
  83.             *.7z|*.arj|*.cab|*.chm|*.deb|*.dmg|*.iso|*.lzh|*.msi|*.rpm|*.udf|*.wim|*.xar)
  84.                          7z x ./"$n"        ;;
  85.             *.xz)        unxz ./"$n"        ;;
  86.             *.exe)       cabextract ./"$n"  ;;
  87.             *)
  88.                          echo "extract: '$n' - unknown archive method"
  89.                          return 1
  90.                          ;;
  91.           esac
  92.       else
  93.           echo "'$n' - file does not exist"
  94.           return 1
  95.       fi
  96.     done
  97. fi
  98. }
  99.  
  100. alias cputemp='sensors | grep Core'
RAW Paste Data
Top