forked from peoii/dotcfg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbash_aliases
109 lines (89 loc) · 2.49 KB
/
bash_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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# Colourize All the Things
alias ls='ls -CF --color=auto'
alias dir='dir --color=auto'
alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
alias diff='colordiff'
alias less='less -R'
# Set some sane defaults
alias df='df -h'
alias du='du -ch'
alias mv='mv -v'
alias cp='cp -v'
alias rm='rm -v'
alias ln='ln -v'
alias diff='diff -u'
alias free='free -mlth'
# Never run as root, always sudo
alias su='su -'
alias sudo='sudo ' #Fix alias post-sudo
# I am seriously lazy
alias cd..='cd ..'
for ((i=2; i <= 8; i++))
do
unset DD
unset DDS
for ((j=0; j < i; j++))
do
DD="${DD}../"
DDS="${DDS}."
done
alias "$DDS"="cd $DD"
done
#alias ..='cd ..'
#alias ...='cd ../..'
#alias ....='cd ../../..'
#alias .....='cd ../../../..'
#alias ......='cd ../../../../../..'
#alias .......='cd ../../../../../../..'
#alias ........='cd ../../../../../../../..'
#alias .........='cd ../../../../../../../../..'
# new commands
alias du1='du --max-depth=1'
alias ll='ls -lF'
alias la='ls -A'
alias pcinfo='inxi -v6 -c10'
alias grouplist='cut -d: -f1 /etc/group'
# git
alias gl='git pull'
alias gp='git push'
alias gd='git diff'
alias gc='git commit'
alias gca='git commit -a'
alias gco='git checkout'
alias gb='git branch'
alias gs='git status'
alias grm="git status | grep deleted | awk '{print \$3}' | xargs git rm"
alias changelog='git log `git log -1 --format=%H -- CHANGELOG*`..; cat CHANGELOG*'
# Generate some random passwords
alias pass='pwgen -s1 18 5'
# Get IPv4 address
alias ipv4="ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print \$2}' | cut -f1 -d'/'"
# Create parent directories
alias mkdir='mkdir -pv'
# Continue downloads by default
alias wget='wget -c --content-disposition'
# handy shortcuts
alias showports='sudo netstat -tulpn'
# Case insensitive grepping!
alias igrep='grep -i'
# List running services
alias servicelist='systemctl --no-page --no-legend --plain -t service --state=running'
# Search for only uncommented linkes
alias uncomment="grep -vE '^#|^$' "
# I hate Mondays...
alias fuck='sudo $(history -p \!\!)'
#eval $(thefuck --alias)
# Octal permissions
alias operms="stat -c '%A %a %n' "
# Parenting changing perms on /
alias chown='chown --preserve-root'
alias chmod='chmod --preserve-root'
alias chgrp='chgrp --preserve-root'
# do not delete / or prompt if deleting more than 3 files at a time
alias rm='rm -I --preserve-root'
# External Tools
alias weather='curl wttr.in/Halifax'
alias moon=' curl wttr.in/Moon'