Skip to content

Instantly share code, notes, and snippets.

@brunobiondi
Last active October 24, 2024 11:10
Show Gist options
  • Save brunobiondi/00cb62bcc4eb0c76a6f5574ff198e5bf to your computer and use it in GitHub Desktop.
Save brunobiondi/00cb62bcc4eb0c76a6f5574ff198e5bf to your computer and use it in GitHub Desktop.
Linux alias commands

Using ~/.bashrc

# brunobiondi

# if it is not Ubuntu
# alias ll='ls -alF'
alias sau='sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y'
alias rebash='source ~/.bashrc'

alias dotenvpull='npx dotenv-vault@latest pull'
alias dotenvpush='npx dotenv-vault@latest push'

alias ncu='npx npm-check-updates -u -i --format group && npm i && npx npm-check-updates -g'

alias sail='sh $([ -f sail ] && echo sail || echo vendor/bin/sail)'
alias art='sh $([ -f sail ] && echo sail artisan || echo vendor/bin/sail artisan)'

alias dc='docker-compose'
alias dockerstop='docker stop $(docker ps -q)'

gitnah () {
    git reset --hard
    git clean -df
    if [ -d ".git/rebase-apply" ] || [ -d ".git/rebase-merge" ]; then
        git rebase --abort
    fi
}

mcd() {
    mkdir -p "$1" && cd "$1"
}
# brunobiondi end

Using ~/.zshrc

# brunobiondi

# if it is not Ubuntu
# alias ll='ls -alF'
alias sau='sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y'
alias rebash='source ~/.zshrc'

alias dotenvpull='npx dotenv-vault@latest pull'
alias dotenvpush='npx dotenv-vault@latest push'

alias ncu='npx npm-check-updates -u -i --format group && npm i && npx npm-check-updates -g'

alias sail='sh $([ -f sail ] && echo sail || echo vendor/bin/sail)'
alias art='sh $([ -f sail ] && echo sail artisan || echo vendor/bin/sail artisan)'

alias dc='docker-compose'
alias dockerstop='docker stop $(docker ps -q)'

gitnah () {
    git reset --hard
    git clean -df
    if [ -d ".git/rebase-apply" ] || [ -d ".git/rebase-merge" ]; then
        git rebase --abort
    fi
}

mcd() {
    mkdir -p "$1" && cd "$1"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment