aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xzsh/.zsh/aliases.zsh86
1 files changed, 81 insertions, 5 deletions
diff --git a/zsh/.zsh/aliases.zsh b/zsh/.zsh/aliases.zsh
index 9076b29..b46df26 100755
--- a/zsh/.zsh/aliases.zsh
+++ b/zsh/.zsh/aliases.zsh
@@ -23,12 +23,17 @@ alias ls="exa"
alias la="exa -a"
alias ll="exa -l"
alias lg="exa -l --git"
+llo() { ls -l "$@" | awk '{k=0;for(i=0;i<=8;i++)k+=((substr($1,i+2,1)~/[rwx]/)*2^(8-i));if(k)printf(" %0o ",k);print}'; }
alias ".."="cd ../"
alias "..."="cd ../.."
-alias "../.."="cd ../.."
-alias rmrf="rm -rf"
+alias ".3"="cd ../../.."
+alias ".4"='cd ../../../../'
+alias ".5"='cd ../../../../..'
+alias rm="rm -i"
+alias rmr="rm -if"
+alias rmrf="rm -irf"
alias psef="ps -ef"
-alias mkdir="mkdir -p"
+alias mkdir="mkdir -pv"
#alias cp="cp -r"
alias cp="rsync -ahvz --progress"
alias cps="sudo rsync -ahvz --progress"
@@ -39,6 +44,8 @@ alias v="nvim"
alias vi="nvim"
alias emacs="nvim"
alias vs="sudo -E nvim"
+alias edit="nvim"
+alias vinstall="v +PluginInstall +qall"
alias g="git"
alias ga="git add -p"
alias gap="git add -p"
@@ -157,9 +164,16 @@ alias tvv="DISPLAY= mpv --quiet -vo tct $@"
alias cppbeautifier="clang-format -style=file -i *.{cpp,h}"
alias term="urxvt"
+alias ip="ip -c a"
+
+# Alias DU
+alias du='du -ch --max-depth=1'
+alias du+='du -ch --max-depth=1 | sort -h -r | less'
+alias dusort='du -x --block-size=1048576 | sort -nr'
+alias df='df -h'
+
+alias c="clear"
-alias size="du -h $1 --max-depth=1"
-alias sizes="sudo du -h $1 --max-depth=1"
alias http_serv="python2 -m SimpleHTTPServer"
#█▓▒░ dumb tmux trix
@@ -170,6 +184,68 @@ alias search="~/.scripts/searx.sh"
alias history="IFS=\$'\\n'; for line in \$(cat ~/.zhistory); do echo \$(date --rfc-3339=ns -d @\$(echo \$line | cut -d' ' -f2 | cut -d':' -f1 | grep -e '^[0-9]') | cut -d'.' -f1)' : '\$(echo \$line | cut -d' ' -f2- | cut -d';' -f2-); done"
alias historyt="cat .zhistory | cut -d' ' -f2- | cut -d';' -f2- | awk '{CMD[\$1]++;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"
alias myip="~/.scripts/ip.sh"
+alias has="HAS_ALLOW_UNSAFE=y has"
+
+alias bc="bc -l"
+alias calc="bc -l"
+
+alias diff="colordiff"
+
+alias h='\history'
+alias j='jobs -l'
+
+alias path='echo -e ${PATH//:/\\n}'
+alias now='date +"%T"'
+alias nowtime=now
+alias nowdate='date +"%d-%m-%Y"'
+
+alias ping='ping -c 5'
+alias fastping='ping -c 100 -s.2'
+
+alias ports='netstat -tulanp'
+
+
+## shortcut for iptables and pass it via sudo#
+alias ipt='sudo /sbin/iptables'
+
+# display all rules #
+alias iptlist='sudo /sbin/iptables -L -n -v --line-numbers'
+alias iptlistin='sudo /sbin/iptables -L INPUT -n -v --line-numbers'
+alias iptlistout='sudo /sbin/iptables -L OUTPUT -n -v --line-numbers'
+alias iptlistfw='sudo /sbin/iptables -L FORWARD -n -v --line-numbers'
+alias firewall=iptlist
+
+# get web server headers #
+alias header='curl -I'
+
+# find out if remote server supports gzip / mod_deflate or not #
+alias headerc='curl -I --compress'
+
+
+# Parenting changing perms on / #
+alias chown='chown --preserve-root'
+alias chmod='chmod --preserve-root'
+alias chgrp='chgrp --preserve-root'
+
+## pass options to free ##
+alias meminfo='free -m -l -t'
+
+## get top process eating memory
+alias psmem='ps auxf | sort -nr -k 4'
+alias psmem10='ps auxf | sort -nr -k 4 | head -10'
+
+## get top process eating cpu ##
+alias pscpu='ps auxf | sort -nr -k 3'
+alias pscpu10='ps auxf | sort -nr -k 3 | head -10'
+
+## Get server cpu info ##
+alias cpuinfo='lscpu'
+
+## older system use /proc/cpuinfo ##
+##alias cpuinfo='less /proc/cpuinfo' ##
+
+## get GPU ram on desktop / laptop##
+alias gpumeminfo='grep -i --color memory /var/log/Xorg.0.log'
#█▓▒░ update mpd database
#function genplaylist() {