dotfiles/.bash_aliases

41 lines
1,007 B
Bash

# Make dir and cd into it
mkcdir () {
mkdir -p -- "$1" &&
cd -P -- "$1"
}
# ls -la
alias l="ls -lh"
alias ll="ls -lah"
alias lll="ls -lah | less"
# cd +
cdl () {
cd -P -- "$1" &&
l
}
cdll () {
cp -P -- "$1" &&
ll
}
# Create standard git WIP commit with timestamps
alias gitw="git commit -m \"wip: $(date +%Y-%m-%dT%H:%M:%S%z) ($(date +%s))\""
# Create a git WIP tag with the current timestamp. Prompt user for tag comment.
alias gitt="git tag -a 'wip-$(date +%s)'"
# Remove dropped upstream git branches from remote
alias gitc="git fetch -p && git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -D"
# Shorthand git pull origin
alias gitp="git pull origin"
# Shorthand git status"
alias gits="git status"
# Generate random 16byte HEX
alias rng16="head -c 16 /dev/random | xxd -p"
# Kill VSCode processes
alias killvscode="ps uxa | grep .vscode-server | awk '{print $2}' | xargs kill -9"
# Change PHP CLI binary
alias chphp="sudo update-alternatives --config php"