Про алиасы в Linux

wget https://wiki.itvideo.pro/dokuwiki/_export/code/linux/vds/bash_aliases?codeblock=1 -O .bash_aliases
.bash_aliases
  1. alias weather='curl -4 http://wttr.in/Novorossiysk'
  2.  
  3. # NETWORK
  4. alias ip='ip -4 -c'
  5. alias ping='ping -4 -c 4'
  6. # Do not wait interval 1 second, go fast #
  7. alias fastping='ping -c 100 -s 2'
  8. alias ports='netstat -tulanp'
  9.  
  10.  
  11. # FILES
  12. alias ls='ls -h --group-directories-first --color=auto'
  13. alias ll='ls -lah --group-directories-first --color=auto'
  14. alias l.='ls -dh .* --color=auto'
  15. alias cd..='cd ..'
  16. alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'"
  17.  
  18. # SEARCH
  19.  
  20. alias grep='grep --color=auto'
  21. alias egrep='egrep --color=auto'
  22. alias fgrep='fgrep --color=auto'
  23. alias nocomment='grep -Ev '"'^(#|$)'"''
  24.  
  25. alias bc='bc -l'
  26.  
  27. alias mkdir='mkdir -pv'
  28.  
  29. alias c='clear;echo -e "\n\n\n"'
  30. alias h='history'
  31. alias j='jobs -l'
  32.  
  33. alias path='echo -e ${PATH//:/\\n}'
  34. alias now='date +"%T"'
  35. alias nowtime=now
  36. alias nowdate='date +"%d-%m-%Y"'
  37.  
  38. alias vi=vim
  39. alias svi='sudo vi'
  40. alias vis='vim "+set si"'
  41. alias edit='vim'
  42. alias bashrc="vim ~/.bashrc && source ~/.bashrc"
  43. #Last opened file in vim
  44. alias lvim='vim -c "normal '\''0"'
  45.  
  46. # confirmation #
  47. alias mv='mv -i'
  48. alias cp='cp -i'
  49. alias ln='ln -i'
  50.  
  51.  
  52. alias apt-get="sudo apt-get"
  53. alias updatey="sudo apt-get --yes"
  54.  
  55. # update on one command
  56. alias update='sudo apt-get update && sudo apt-get upgrade'
  57.  
  58. alias root='sudo -i'
  59. alias su='sudo -i'
  60.  
  61. alias reboot='sudo /sbin/reboot'
  62. alias poweroff='sudo /sbin/poweroff'
  63. alias halt='sudo /sbin/halt'
  64. alias shutdown='sudo /sbin/shutdown'
  65.  
  66. alias wget='wget -c'
  67.  
  68. ## set some other defaults ##
  69. alias df='df -H'
  70. alias du='du -ch' #not delete / or prompt if deleting more than 3 files at a time #
  71.  
  72.  
  73. # Parenting changing perms on / #
  74. alias chown='chown --preserve-root'
  75. alias chmod='chmod --preserve-root'
  76. alias chgrp='chgrp --preserve-root'
  77. alias rm='rm -I --preserve-root'
  78.  
  79. alias mount='mount |column -t'
  80.  
  81.  
  82. # shortcut for iptables and pass it via sudo
  83. alias ipt='sudo /sbin/iptables'
  84.  
  85. # display all rules
  86. alias iptlist='sudo /sbin/iptables -L -n -v --line-numbers'
  87. alias iptlistin='sudo /sbin/iptables -L INPUT -n -v --line-numbers'
  88. alias iptlistout='sudo /sbin/iptables -L OUTPUT -n -v --line-numbers'
  89. alias iptlistfw='sudo /sbin/iptables -L FORWARD -n -v --line-numbers'
  90. alias firewall=iptlist
  91.  
  92. alias untar='tar -zxvf'
  93.  
  94.  
  95. # also pass it via sudo so whoever is admin can reload it without calling you
  96. alias nginxreload='sudo /usr/local/nginx/sbin/nginx -s reload'
  97. alias nginxtest='sudo /usr/local/nginx/sbin/nginx -t'
  98. alias lightyload='sudo /etc/init.d/lighttpd reload'
  99. alias lightytest='sudo /usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf -t'
  100. alias httpdreload='sudo /usr/sbin/apachectl -k graceful'
  101. alias httpdtest='sudo /usr/sbin/apachectl -t && /usr/sbin/apachectl -t -D DUMP_VHOSTS'
  102.  
  103. #Grabs the disk usage in the current directory
  104. alias usage='du -ch | grep total'
  105.  
  106. #Gets the total disk usage on your machine
  107. alias totalusage='df -hl --total | grep total'
  108.  
  109. #Shows the individual partition usages without the temporary memory values
  110. alias partusage='df -hlT --exclude-type=tmpfs --exclude-type=devtmpfs'
  111.  
  112. #Gives you what is using the most space. Both directories and files. Varies on
  113. #current directory
  114. alias most='du -hsx * | sort -rh | head -10'
  115.  
  116. # GIT
  117.  
  118. alias g='git'
  119. alias gr='git rm -rf'
  120. alias gs='git status'
  121. alias ga='g add'
  122. alias gc='git commit -m'
  123. alias gp='git push origin master'
  124. alias gl='git pull origin master'