Skip to content

Instantly share code, notes, and snippets.

Last active July 2, 2023 14:15
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save pixelbrackets/8c19f0b03b805d4c179b to your computer and use it in GitHub Desktop.
Bash Aliases
### path
alias sl='ls'
alias la='ls -alh'
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
### git
alias gll='git log --graph --pretty=oneline --abbrev-commit'
alias gls='git log -7 --oneline'
alias st='git status'
alias gitst='git status'
alias gb='git branch -a'
alias gbm='git branch -a --merged'
alias gfix='git diff --name-only -z | uniq -z | xargs --null subl'
alias got='git'
alias gut='git'
### youtube-dl
alias youtube-dl-audio='youtube-dl -ti --extract-audio --audio-format mp3'
alias youtube-dl-video='youtube-dl -ti'
### zip
alias ctar='tar -czf'
alias xtar='tar -xzf'
### misc
alias cachewarmup='wget --spider --force-html -r -l10 --directory-prefix=/tmp/ --no-directories --delete-after'
alias copy='xclip -sel clip'
alias fixchmod='find ./ \( -type d -exec chmod 755 {} + \) -o \( -type f -exec chmod 644 {} + \)'
alias directorysize='du -hc --max-depth=1'
alias directoryshowlargefiles='find ./ -type f -size +20000k'
alias password='pwgen -s 32 -1'
alias passwordcp='pwgen -s 32 -1 | xclip -sel clip'
alias phpinteractive='php -a'
alias please='sudo $(history -p \!\!)'
alias runrepeatedly='watch -n 1'
alias shrinkimages='mogrify -resize 1024x *.JPG'
alias unixtime='date +%s'
alias vmi='vim'
### local shortcuts
alias cdgit="cd ~/git"
alias fixchown='chown -R johndoe:johndoe ./'
### perform mkdir and cd using a single command
function take () { mkdir -p "$@" && eval cd "\"\$$#\""; }
Copy link

PS: Check out my list of Git aliases as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment