My dotfiles for my Linux rice managed with stow and make
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

.bash_aliases 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. if [ -x /usr/bin/dircolors ]; then
  2. test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
  3. alias ls='ls --color=auto'
  4. #alias dir='dir --color=auto'
  5. #alias vdir='vdir --color=auto'
  6. alias grep='grep --color=auto'
  7. alias fgrep='fgrep --color=auto'
  8. alias egrep='egrep --color=auto'
  9. fi
  10. alias sl='sl -e'
  11. alias l='ls -CF'
  12. alias ll='ls -alF'
  13. alias la='ls -A'
  14. alias cdb='cd -'
  15. alias ..='cd ..'
  16. alias ...='cd ../..'
  17. alias cp='rsync'
  18. alias cpr='rsync -r'
  19. alias speedtest='speedtest-cli'
  20. alias alsamixer='alsamixer -c 1'
  21. alias gdrive='google-drive-ocamlfuse ~/Google\ Drive/'
  22. alias ugdrive='sudo umount ~/Google\ Drive/'
  23. alias todo='vi ~/.todo'
  24. alias dataBackup='/home/micah/backupScript/backup.sh'
  25. alias dataBackupUmount='/home/micah/backupScript/backup.sh && sleep 5 && sudo umount /dev/sdd1'
  26. alias makescript="fc -rnl | head -1 >"
  27. alias histg='history | grep'
  28. alias cmount='mount | column -t'
  29. alias tree="ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'"
  30. alias tree2="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'"
  31. alias meminfo='free -m -l -t'
  32. alias ps?='ps aux | grep'
  33. alias ipinfo="curl ifconfig.me && curl ifconfig.me/host"
  34. alias bashrc="vi ~/.bashrc"
  35. alias bashalias="vi ~/.bash_aliases"
  36. alias katawa="/home/micah/data/Videos/Anime/Visual\ Novels/Katawa\ Shoujo-linux/Katawa\ Shoujo.sh"
  37. alias python="python3"
  38. alias mysql="mysql -u root -p"
  39. alias aptclean="sudo apt-get autoremove ; sudo apt-get autoclean; sudo apt-get install -f ; sudo apt-get clean"
  40. alias aptupgrade="sudo apt-get update ; sudo apt-get -y upgrade ; sudo apt-get -y dist-upgrade ; sudo apt-get -y autoremove ; sudo apt-get -y autoclean; sudo apt-get -y install -f ; sudo apt-get -y clean"
  41. alias setCurrentProject='pwd > ~/.current_project'
  42. alias currentProject='cd `cat ~/.current_project`'
  43. # Add an "alert" alias for long running commands. Use like so:
  44. # sleep 10; alert
  45. 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$//'\'')"'
  46. getlocation() { lynx -dump http://www.ip-adress.com/ip_tracer/?QRY=$1|grep address|egrep 'city|state|country'|awk '{print $3,$4,$5,$6,$7,$8}'|sed 's\ip address flag \\'|sed 's\My\\';}
  47. mcd() { mkdir -p "$1"; cd "$1";}
  48. cls() { cd "$1"; ls;}
  49. crun() { make "$1"; ./$1;}
  50. backup() { cp "$1"{,.bak};}
  51. md5check() { md5sum "$1" | grep "$2";}
  52. ctree() { cd "$1"; ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'; cd -; }
  53. extract() {
  54. if [ -f $1 ] ; then
  55. case $1 in
  56. *.tar.bz2) tar xjf $1 ;;
  57. *.tar.gz) tar xzf $1 ;;
  58. *.tar.xz) tar xf $1 ;;
  59. *.bz2) bunzip2 $1 ;;
  60. *.rar) unrar e $1 ;;
  61. *.gz) gunzip $1 ;;
  62. *.tar) tar xf $1 ;;
  63. *.tbz2) tar xjf $1 ;;
  64. *.tgz) tar xzf $1 ;;
  65. *.txz) tar xf $1 ;;
  66. *.zip) unzip $1 ;;
  67. *.z) uncompress $1 ;;
  68. *.7z) 7z x $1 ;;
  69. *.jar) jar xf $1 ;;
  70. *) echo "'$1' cannot be extracted via extract()"
  71. esac
  72. else
  73. echo "'$1' is not a valid file"
  74. fi
  75. }
  76. #C compiling shortcuts for clang and gcc
  77. clang() {
  78. if [[ $1 =~ \.c$ ]]; then
  79. clang-3.5 -g $1 -o ${1%%.*};
  80. else
  81. echo "$1 is not a c file"
  82. fi
  83. }
  84. clanglm() {
  85. if [[ $1 =~ \.c$ ]]; then
  86. clang-3.5 -g $1 -o ${1%%.*} -lm;
  87. else
  88. echo "$1 is not a c file"
  89. fi
  90. }
  91. gccc() {
  92. if [[ $1 =~ \.c$ ]]; then
  93. gcc -std=c99 -Wall -pedantic -Wextra -Werror -O2 -g $1 -o ${1%%.*};
  94. else
  95. echo "$1 is not a c file"
  96. fi
  97. }
  98. gcclm() {
  99. if [[ $1 =~ \.c$ ]]; then
  100. gcc -std=c99 -g $1 -o ${1%%.*} -lm;
  101. else
  102. echo "$1 is not a c file"
  103. fi
  104. }