Skip to content

Instantly share code, notes, and snippets.

@nickylimjj
Last active April 16, 2020 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nickylimjj/fc08049fc9b115d5732240bc655a3952 to your computer and use it in GitHub Desktop.
Save nickylimjj/fc08049fc9b115d5732240bc655a3952 to your computer and use it in GitHub Desktop.
# .bash_aliases
# Useful commands for the terminal
# Created by Nicky Lim
# some references from
## https://www.cyberciti.biz/tips/bash-aliases-mac-centos-linux-unix.html
############################
# Useful in-built commands #
############################
## alt + . get last argument
## `!!` last output
## ctrl + r reverse-search
## ctrl + a start of line
## ctrl + e end of line
## $[1+0xde] evaluate math
###########
# Aliases #
###########
# Copy/paste
alias "c=xclip"
alias "v=xclip -o"
alias "cs=xclip -selection clipboard"
# SHA1 digest generation
alias sha1='openssl sha1'
# Folder generation
alias mkdir='mkdir -pv'
# Colorful comparison (requires apt install colordiff)
alias diff='colordiff'
# sudo vim
alias svi='sudo vi'
# Confirmation of overwrite
alias mv='mv -i'
alias cp='cp -i'
alias ln='ln -i'
# Resume wget by default
alias wget='wget -c'
# save last stdout to $LAST
PROMPT_COMMAND='LAST="`cat /tmp/x`"; exec >/dev/tty; exec > >(tee /tmp/x)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment