-
Notifications
You must be signed in to change notification settings - Fork 226
/
.alias
69 lines (51 loc) · 1.84 KB
/
.alias
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Shortcuts
alias reload="source ~/.bash_profile"
alias _="sudo"
alias g="git"
alias rr="rm -rf"
# Default options
alias rsync="rsync -vh"
alias json="json -c"
alias psgrep="psgrep -i"
# Global aliases
if $(is-supported "alias -g"); then
alias -g G="| grep -i"
alias -g H="| head"
alias -g T="| tail"
alias -g L="| less"
fi
# List declared aliases, functions, paths
alias aliases="alias | sed 's/=.*//'"
alias functions="declare -f | grep '^[a-z].* ()' | sed 's/{$//'"
alias paths='echo -e ${PATH//:/\\n}'
# Directory listing/traversal
LS_COLORIZED=$(is-supported "ls --color" --color -G)
LS_TIMESTYLEISO=$(is-supported "ls --time-style=long-iso" --time-style=long-iso)
LS_GROUPDIRSFIRST=$(is-supported "ls --group-directories-first" --group-directories-first)
alias l="ls -lahA $LS_COLORIZED $LS_TIMESTYLEISO $LS_GROUPDIRSFIRST"
alias ll="ls -lA $LS_COLORIZED"
alias lt="ls -lhAtr $LS_COLORIZED $LS_TIMESTYLEISO $LS_GROUPDIRSFIRST"
alias ld="ls -ld $LS_COLORIZED */"
alias lp="stat -c '%a %n' *"
unset LS_COLORIZED LS_TIMESTYLEISO LS_GROUPDIRSFIRST
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
alias -- -="cd -" # Go to previous dir with -
alias cd.='cd $(readlink -f .)' # Go to real dir (i.e. if current dir is linked)
# p/npm
alias p="pnpm"
alias ni="npm install"
alias nu="npm uninstall"
alias ncu="npm-check-updates --interactive"
alias ncuw="npm-check-updates --interactive --root --workspaces"
# Network
alias ip="curl -s ipinfo.io | jq -r '.ip'"
alias ipl="ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1'"
# Miscellaneous
alias hosts="sudo $EDITOR /etc/hosts"
alias quit="exit"
alias week="date +%V"
alias speedtest="wget -O /dev/null http://speed.transip.nl/100mb.bin"
alias grip="grip --browser --pass=$GITHUB_TOKEN"