Advertisement
Guest User

moe raspberry pi bash_aliases

a guest
Dec 16th, 2017
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.89 KB | None | 0 0
  1. alias ll='ls -l'
  2. alias la='ls -A'
  3. alias l='ls -CF'
  4.  
  5. function showhist {
  6. history > 'date +%Y-%m-%d'.txt
  7. }
  8. #trap show_history EXIT
  9.  
  10.  
  11. #$ echo -e "function alia { \n echo -e \"\n function \$1 { \n \$2 \n }\" >> ~/.bashrc \n }" >> ~/.bashrc$ echo -e "function alia { \n echo -e \"\n function \$1 { \n \$2 \n }\" >> ~/.bashrc \n }" >> ~/.bashrc
  12. # restart shell to use
  13. # usage: $ alia "name" "cmd"
  14. # e.g.: $ alia "gac" "git add -A; git commit -m \"\$1\" "
  15. # $ bash
  16. # $ gac "my commit message"
  17. #
  18. # $1 refers to a variable
  19. # note that $ and " characters are escaped in the alias content
  20. hgrep () {
  21. history | egrep --color=auto --recursive "$@" | egrep --color=auto --recursive -v "hgrep $@"
  22. }
  23.  
  24.  
  25. function fu() {
  26. if [ ! $1 ]; then
  27. echo "Usage: fuck you process_name"
  28. exit
  29. fi
  30.  
  31. if killall $2; then
  32. echo
  33. echo " (╯°□°)╯ ︵$(echo $2 | flip)"
  34. echo
  35. fi
  36. }
  37.  
  38.  
  39. alias instl='sudo apt-get install'
  40. alias update='sudo apt-get update && sudo apt-get upgrade && sudo apt-get autoremove'
  41. alias rebt='sudo shutdown -r now'
  42. alias mostuse=$'history | awk \'{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] \" \" CMD[a]/count*100 \"% \" a;}\' | grep -v \"./\" | column -c3 -s \" \" -t | sort -nr | nl | head -n10'
  43. alias fhere="find . -name"
  44. alias lsl="ls -lhFA | less"
  45. alias ..="cd .."
  46. alias df="df -Tha --total"
  47. alias editbash="sudo nano ~/.bashrc"
  48. alias srcbash=". ~/.bashrc"
  49. alias sizes="du -h | perl -e 'sub h{%h=(K=>10,M=>20,G=>30);($n,$u)=shift=~/([0-9.]+)(\D)/;return $n*2**$h{$u}}print sort{h($b)<=>h($a)}<>;'"
  50. alias nn="sudo nano "
  51. alias on3="/var/www/html/rfoutlet/codesend 1382147"
  52. alias of3="/var/www/html/rfoutlet/codesend 1382156"
  53. alias on2="/var/www/html/rfoutlet/codesend 1382156"
  54. alias of2="/var/www/html/rfoutlet/codesend 1382156"
  55.  
  56. alias version="lsb_release -a"
  57.  
  58. alias stopp="sudo systemctl stop "
  59. alias rstrt="sudo systemctl restart "
  60. alias status="sudo systemctl status "
  61. alias showalias='cat ~/.bash_aliases | grep alias'
  62. alias editalias='sudo nano ~/.bash_aliases'
  63.  
  64. alias editocto='nn ~/.octoprint/config.yaml'
  65. alias runocto='cd ~/Downloads/OctoPrint/venv/bin/ && ./octoprint &'
  66. alias psg="ps aux | grep -v grep | grep -i -e VSZ -e"
  67. alias highperm="sudo chmod a+x "
  68. alias bb="sudo !!"
  69. alias runmjpg='~/Downloads/mjpg-streamer/mjpg_streamer -i \" /usr/local/lib/input_uvc.so \" -o \" /usr/local/lib/output_http.so -w /usr/local/www \" '
  70. alias initd='ls /etc/init.d && cd $_'
  71. alias edithomebridge='nano ~/.homebridge/config.json'
  72. alias runhomebridge=' node /opt/node/bin/homebridge & '
  73. #alias wifisig='sudo iwlist wlan0 scan | egrep \" Cell|ESSID|Signal|Rates \" '
  74. alias hceeng='hsg for searching history, mcd for mkdir and cd'
  75. function wifisign {
  76. sudo iwlist wlan0 scan | egrep "Cell|ESSID|Signal|Rates"
  77. }
  78. function hsg {
  79. history | grep -i $1
  80. }
  81.  
  82. mcd () {
  83. mkdir -p $1
  84. cd $1
  85. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement