diff --git a/.aliases b/.aliases index 2b4ea1349..167a919f4 100644 --- a/.aliases +++ b/.aliases @@ -15,22 +15,22 @@ for opener in browser-exec xdg-open cmd.exe cygstart "start" open; do done # Linux specific aliases -alias pbcopy='xclip -selection clipboard' -alias pbpaste='xclip -selection clipboard -o' +alias pbcopy='xclip -selection clipboard' \ +pbpaste='xclip -selection clipboard -o' # Easier navigation: .., ..., ...., ....., ~ and - -alias ..="cd .." -alias ...="cd ../.." -alias ....="cd ../../.." -alias .....="cd ../../../.." -alias ~="cd ~" # `cd` is probably faster to type though -alias -- -="cd -" +alias ..="cd .." \ +...="cd ../.." \ +....="cd ../../.." \ +.....="cd ../../../.." \ +~="cd ~" \ +-- -="cd -" # Shortcuts -alias dl="cd ~/Downloads" -alias g="git" -alias h="history" -alias gc=". /usr/local/bin/gitdate && git commit -v " +alias dl="cd ~/Downloads" \ +g="git" \ +h="history" \ +gc=". /usr/local/bin/gitdate && git commit -v " # Detect which `ls` flavor is in use if ls --color > /dev/null 2>&1; then # GNU `ls` @@ -69,16 +69,16 @@ alias week='date +%V' alias timer='echo "Timer started. Stop with Ctrl-D." && date && time cat && date' # IP addresses -alias pubip="dig +short myip.opendns.com @resolver1.opendns.com" -alias localip="sudo ifconfig | grep -Eo 'inet (addr:)?([0-9]*\\.){3}[0-9]*' | grep -Eo '([0-9]*\\.){3}[0-9]*' | grep -v '127.0.0.1'" -alias ips="sudo ifconfig -a | grep -o 'inet6\\? \\(addr:\\)\\?\\s\\?\\(\\(\\([0-9]\\+\\.\\)\\{3\\}[0-9]\\+\\)\\|[a-fA-F0-9:]\\+\\)' | awk '{ sub(/inet6? (addr:)? ?/, \"\"); print }'" +alias pubip="dig +short myip.opendns.com @resolver1.opendns.com" \ +localip="sudo ifconfig | grep -Eo 'inet (addr:)?([0-9]*\\.){3}[0-9]*' | grep -Eo '([0-9]*\\.){3}[0-9]*' | grep -v '127.0.0.1'" \ +ips="sudo ifconfig -a | grep -o 'inet6\\? \\(addr:\\)\\?\\s\\?\\(\\(\\([0-9]\\+\\.\\)\\{3\\}[0-9]\\+\\)\\|[a-fA-F0-9:]\\+\\)' | awk '{ sub(/inet6? (addr:)? ?/, \"\"); print }'" # Flush Directory Service cache alias flush="dscacheutil -flushcache && killall -HUP mDNSResponder" # View HTTP traffic -alias sniff="sudo ngrep -d 'en1' -t '^(GET|POST) ' 'tcp and port 80'" -alias httpdump="sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E \"Host\\: .*|GET \\/.*\"" +alias sniff="sudo ngrep -d 'en1' -t '^(GET|POST) ' 'tcp and port 80'" \ +httpdump="sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E \"Host\\: .*|GET \\/.*\"" # Canonical hex dump; some systems have this symlinked command -v hd > /dev/null || alias hd="hexdump -C" @@ -123,17 +123,13 @@ alias hosts='sudo vim /etc/hosts' # copy working directory alias cwd='pwd | tr -d "\r\n" | xclip -selection clipboard' -# copy file interactive -alias cp='cp -i' - -# move file interactive -alias mv='mv -i' +# file interactive alias +alias cp='cp -i' \ +mv='mv -i' # untar alias untar='tar xvf' -# Pipe my public key to my clipboard. -alias pubkey="more ~/.ssh/id_ed25519.pub | xclip -selection clipboard | echo '=> Public key copied to pasteboard.'" - -# Pipe my private key to my clipboard. -alias prikey="more ~/.ssh/id_ed25519 | xclip -selection clipboard | echo '=> Private key copied to pasteboard.'" +# Pipe my keys to my clipboard. +alias pubkey="more ~/.ssh/id_ed25519.pub | xclip -selection clipboard | echo '=> Public key copied to pasteboard.'" \ +prikey="more ~/.ssh/id_ed25519 | xclip -selection clipboard | echo '=> Private key copied to pasteboard.'"