1
0

aliases.sh 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #!/bin/bash
  2. # ls
  3. alias l='ls -lFh' # size,show type,human readable
  4. alias la='ls -lAFh' # long list,show almost all,show type,human readable
  5. alias lr='ls -tRFh' # sorted by date,recursive,show type,human readable
  6. alias lt='ls -ltFh' # long list,sorted by date,show type,human readable
  7. alias ll='ls -l' # long list
  8. alias lth='lt | head -16' # latest 15
  9. alias dfh='df -h' # df
  10. # du
  11. alias duh="du -sh * | sort -h"
  12. # export local .env file
  13. alias export-env="export \$(grep -v '^#' .env | xargs -0)"
  14. # docker
  15. alias d='docker'
  16. alias dc='docker compose'
  17. # k8s
  18. alias k='kubectl'
  19. alias kx='kubectx'
  20. # http
  21. alias http-server='python3 -m http.server'
  22. # osx-only aliases
  23. if [[ "$(uname -s)" = 'Darwin' ]]; then
  24. alias get-buffer="$HOME/dotfiles/bin/get-iterm2-buffer"
  25. alias chrome-tabs="$HOME/dotfiles/bin/chrome-tabs"
  26. fi
  27. # node
  28. alias scripts="jq .scripts package.json"
  29. # other bin
  30. alias awsp="$HOME/dotfiles/bin/aws-profile"
  31. # display docker statuses
  32. alias dockerps="docker ps --format 'table {{.Names}}\t{{.Image}}\t{{.Status}}'"
  33. # set terminal title
  34. function title {
  35. echo -ne "\033]0;"$*"\007"
  36. }
  37. alias branchpr="git checkout -b fix/grrowl-\$(date +%s) && gh pr create -w"
  38. # generate password
  39. alias pwgen="openssl rand -base64"
  40. alias rssi="/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | egrep -E 'agrCtlRSSI|agrCtlNoise|lastTxRate'"
  41. # dtach
  42. dtach-job() {
  43. if [ -z $2 ]; then
  44. dtach -a $1.dtach
  45. else
  46. dtach -n $1.dtach /bin/bash -c "${@:2} >> $1.log 2>&1"
  47. fi
  48. }
  49. # better watch
  50. alias watchx="watch -cd -n 2"