-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.aliases
45 lines (35 loc) · 1.11 KB
/
.aliases
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
OS=$(command uname -s)
if [[ "${OS}" == "Darwin" ]]; then
# macOS has no md5sum so we use md5 as fallback
command -v md5sum > /dev/null || alias md5sum="md5"
# macOS has no sha1sum so we use shasum as fallback
command -v sha1sum > /dev/null || alias sha1sum="shasum"
else
alias chown="chown --preserve-root"
alias chmod="chmod --preserve-root"
alias chgrp="chgrp --preserve-root"
eval "$(dircolors -b)"
fi
# Set editor
alias vim="nvim"
# Use python3 as default
alias python=python3
alias pip=pip3
# Common for all OS
alias ls="ls --color=auto"
alias grep="grep --color=auto"
alias fgrep="fgrep --color=auto"
alias mkdir="mkdir -p"
alias diff="colordiff"
alias mount="mount | column -t"
alias c="clear"
alias h="history"
alias j="jobs -l"
# Know your public IP addresses
alias my_public_ipv4="curl -4 icanhazip.com"
alias my_public_ipv6="curl -6 icanhazip.com"
## Show active network interfaces
alias ifactive="ifconfig | pcregrep -M -o '^[^\t:]+:([^\n]|\n\t)*status: active'"
alias kubectl="kubecolor"
# Canonical hex dump; some systems have this symlinked
command -v hd > /dev/null || alias hd="hexdump -C"