forked from slomkowski/bash-full-of-colors
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bash_aliases.sh
55 lines (44 loc) · 1.18 KB
/
bash_aliases.sh
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
#!/usr/bin/env bash
export __LS_OPTIONS='--color=auto -h'
alias ls='ls $__LS_OPTIONS'
alias ll='ls $__LS_OPTIONS -l'
alias la='ls $__LS_OPTIONS -la'
alias l='ls $__LS_OPTIONS -CF'
alias sl='ls $__LS_OPTIONS'
alias cd..='cd ..'
alias ..='cd ..'
alias ...='cd ../..'
alias bc='bc -l'
alias mkdir='mkdir -p -v'
alias mv='mv -iv'
alias rm='rm -Iv --one-file-system --preserve-root'
# function checks if the application is installed
function __add_command_replace_alias() {
if [ -x "`which $2 2>&1`" ]; then
alias $1=$2
fi
}
if [ -x "`which most 2>&1`" ]; then
alias less=most
export PAGER=most
fi
if [ -x "`which vim 2>&1`" ]; then
export EDITOR=vim
fi
__add_command_replace_alias tail 'multitail'
__add_command_replace_alias df 'pydf'
__add_command_replace_alias traceroute 'mtr'
__add_command_replace_alias tracepath 'mtr'
__add_command_replace_alias top 'htop'
function allcolors() {
# credit to http://askubuntu.com/a/279014
for x in 0 1 4 5 7 8; do
for i in `seq 30 37`; do
for a in `seq 40 47`; do
echo -ne "\e[$x;$i;$a""m\\\e[$x;$i;$a""m\e[0;37;40m "
done
echo
done
done
echo ""
}