aliases.sh 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. # export local .env file
  11. alias export-env="export \$(grep -v '^#' .env | xargs -0)"
  12. # docker
  13. alias d='docker'
  14. alias dc='docker compose'
  15. # k8s
  16. alias k='kubectl'
  17. alias kx='kubectx'
  18. # http
  19. alias http-server='python -m SimpleHTTPServer'
  20. # osx-only aliases
  21. if [[ "$(uname -s)" = 'Darwin' ]]; then
  22. alias get-buffer="$HOME/dotfiles/bin/get-iterm2-buffer"
  23. alias chrome-tabs="$HOME/dotfiles/bin/chrome-tabs"
  24. fi
  25. # node
  26. alias scripts="jq .scripts package.json"
  27. # other bin
  28. alias awsp="$HOME/dotfiles/bin/aws-profile"
  29. # display docker statuses
  30. alias dockerps="docker ps --format 'table {{.Names}}\t{{.Image}}\t{{.Status}}'"
  31. # set terminal title
  32. function title {
  33. echo -ne "\033]0;"$*"\007"
  34. }
  35. alias branchpr="git checkout -b fix/grrowl-\$(date +%s) && gh pr create -w"
  36. # generate password
  37. alias pwgen="openssl rand -base64"