Peter's zsh configuration files
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.

aliases.zsh 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #!zsh
  2. # stuff for every os
  3. alias vared="IFS=\$'\n' vared"
  4. alias bc='bc -q'
  5. alias lc='fc -lnD -1'
  6. alias h='history -fdD'
  7. alias j='jobs -l'
  8. alias f="find . -name"
  9. alias g="egrep"
  10. # ls command
  11. if [[ $OSNAME == "FreeBSD" || $OSNAME == "Darwin" ]]; then
  12. alias ls='ls -G'
  13. alias l='ls -lFGh'
  14. alias ll='ls -lFGh'
  15. alias la='ls -lFGha'
  16. elif [[ $OSNAME == "Linux" || $OSNAME == "CYGWIN_NT-5.0" ]]; then
  17. alias ls='\ls --color=auto --group-directories-first'
  18. alias lsa='ls -A'
  19. alias l='\ls -lhF --color=auto --group-directories-first'
  20. alias ll='l'
  21. alias la='l -A'
  22. alias _df_awk="awk '{print \$2 \"\\t\" \$4 \"\\t\" \$5 \"\\t\" \$6}'"
  23. alias df="df -hP|_df_awk"
  24. else
  25. alias l='ls -lF'
  26. alias ll='ls -lF'
  27. alias la='ls -lFa'
  28. fi
  29. # ps
  30. if [[ $OSNAME == "FreeBSD" ]]; then
  31. alias p='ps -axwwopid,ppid,user,pcpu,vsz,rss,comm,args'
  32. elif [[ $OSNAME == "Darwin" ]]; then
  33. alias p='ps -axwwopid,ppid,user,pcpu,vsz,rss,command'
  34. elif [[ $OSNAME == "Linux" || $OSNAME == "CYGWIN_NT-5.0" ]]; then
  35. alias p='ps -ewwopid,ppid,user,pcpu,vsz,rss,comm,args'
  36. elif [[ $OSNAME == "AIX" || $OSNAME == "HP-UX" ]]; then
  37. alias p='ps -eopid,ppid,user,pcpu,vsz,comm,args'
  38. else
  39. alias p='ps -eopid,ppid,user,pcpu,vsz,rss,comm,args'
  40. fi
  41. # ps | grep
  42. alias pg="p|g"
  43. # ldd
  44. if [[ $OSNAME == "Darwin" ]]; then
  45. alias ldd='otool -L'
  46. fi
  47. # Just to shorten typing
  48. alias mrs='mr -d ~ status'
  49. alias gpg=gpg2
  50. alias virsh-vnc='vnc localhost $(expr 5900 + $(virsh vncdisplay $1|head -1|sed "s/^.*://"))'