Skip to content

Instantly share code, notes, and snippets.

@Kehet
Last active February 7, 2018 13:44
Show Gist options
  • Save Kehet/3d0bab4380dc14d3f443 to your computer and use it in GitHub Desktop.
Save Kehet/3d0bab4380dc14d3f443 to your computer and use it in GitHub Desktop.
My bash aliases
# gnome
alias go='nohup xdg-open 1>/dev/null 2>&1'
# apt
alias sai='sudo apt install'
alias sau='sudo apt update'
alias saa='sudo apt autoremove'
alias sadu='sudo apt dist-upgrade'
alias acs='apt-cache search'
alias sall='sau && sadu && saa'
# vagrant
alias vup='vagrant up'
alias vha='vagrant halt'
alias vss='vagrant ssh'
alias vups='vup && vss'
alias vre='vha && vup'
alias vres='vha && vups'
# homestead
function homestead() {
( builtin cd ~/Homestead && vagrant $* )
}
alias hup='pushd ~/Homestead && vup && popd'
alias hha='pushd ~/Homestead && vha && popd'
alias hss='pushd ~/Homestead && vss && popd'
alias hups='pushd ~/Homestead && vups && popd'
alias hre='pushd ~/Homestead && vre && popd'
alias hres='pushd ~/Homestead && vres && popd'
alias hedit='nano ~/Homestead/Homestead.yaml'
function mydigi() {
( builtin cd ~/Code/mydigi && vagrant $* )
}
alias mup='pushd ~/Code/mydigi && vup && popd'
alias mha='pushd ~/Code/mydigi && vha && popd'
alias mss='pushd ~/Code/mydigi && vss && popd'
alias mups='pushd ~/Code/mydigi && vups && popd'
alias mre='pushd ~/Code/mydigi && vre && popd'
alias mres='pushd ~/Code/mydigi && vres && popd'
# general
alias cp='cp -iv' # Preferred 'cp' implementation
alias mv='mv -iv' # Preferred 'mv' implementation
alias mkdir='mkdir -pv' # Preferred 'mkdir' implementation
alias ll='ls -FlAhp' # Preferred 'ls' implementation
alias lc='colorls --sort-files --long'
alias less='less -FSRXc' # Preferred 'less' implementation
cd() { builtin cd "$@" && ll; } # Always list directory contents upon 'cd'
alias cd..='cd ../' # Go back 1 directory level (for fast typers)
alias ..='cd ../' # Go back 1 directory level
alias ...='cd ../../' # Go back 2 directory levels
alias .3='cd ../../../' # Go back 3 directory levels
alias .4='cd ../../../../' # Go back 4 directory levels
alias .5='cd ../../../../../' # Go back 5 directory levels
alias .6='cd ../../../../../../' # Go back 6 directory levels
alias ~="cd ~" # ~: Go Home
alias c='clear' # c: Clear terminal display
mcd () { mkdir -p "$1" && cd "$1"; } # mcd: Makes new Dir and jumps inside
trash () { mv "$@" /tmp ; } # trash: Moves a file to the /tmp
alias DT='tee ~/terminalOut.txt' # DT: Pipe content to file on Desktop
zipf () { zip -r "$1".zip "$1" ; } # zipf: To create a ZIP archive of a folder
gzf () { tar czf "$1".tar.gz "$1" ; } # gzf: To create a .tar.gz archieve of a folder
alias pbcopy='xclip -selection clipboard'
alias pbpaste='xclip -selection clipboard -o'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment