Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 131 lines (104 sloc) 3.428 kb
39ffca0 @gabesoft bash and vim settings
authored
1 # .bashrc
2
3 # User specific aliases and functions
92b6ed4 @gabesoft cron update
authored
4 # alias = list all aliases
f736ae6 @gabesoft cron update
authored
5 # cd = navigate home
6 # cd - = navigate to previous folder
7
8 #navigation
9 alias ..='cd ..'
10 alias ...='cd .. ; cd ..'
39ffca0 @gabesoft bash and vim settings
authored
11
12 # delete
13 alias rm='rm -i'
14 alias rf='rm -f'
15 alias rr='rm -f -r'
16
17 # copy move
18 alias cp='cp -i'
19 alias mv='mv -i'
20
21 # list directory
ebae7a2 @gabesoft cron update
authored
22 alias ls='ls --color=auto'
39ffca0 @gabesoft bash and vim settings
authored
23 alias ll='ls -hl'
24 alias la='ls -a'
25 alias lla='ls -lah'
26
5f862ba @gabesoft cron update
authored
27 # grep / find
28 alias g='grep -i'
29 alias f='find . -iname'
30
31 # list the size of all folders and files
32 alias ducks='du -cks * | sort -rn|head -11'
33
34 # system log
35 alias systail='tail -f /var/log/system.log'
36
37 # show most used commands
38 alias profileme="history | awk '{print \$2}' | awk 'BEGIN{FS=\"|\"}{print \$1}' | sort | uniq -c | sort -n | tail -n 20 | sort -nr"
39
39ffca0 @gabesoft bash and vim settings
authored
40 # disk usage
41 alias df='df -h'
42
43 # tar
44 alias untar='tar xvzf'
45
9ea3afb @gabesoft cron update
authored
46 # execute permissions
47 alias exusr='chmod u+x' # current user
48 alias exall='chmod ugo+x' # all users
49
39ffca0 @gabesoft bash and vim settings
authored
50 # version
51 alias ver='cat /etc/redhat-release'
52
ae4046b @gabesoft cron update
authored
53 # list all colors
91369a4 @gabesoft cron update
authored
54 alias colors="set | egrep '^COLOR_\w*'"
39ffca0 @gabesoft bash and vim settings
authored
55
dd50a70 @gabesoft cron update
authored
56 # git tab completion
57 source ~/git-completion.bash
58
59 # show git branch in status line
bd160ab @gabesoft cron update
authored
60 export PS1="\[${COLOR_BROWN}\]\w\[${COLOR_CYAN}\]\$(__git_ps1)\[${COLOR_BROWN}\]> \[${COLOR_NC}\]"
dd50a70 @gabesoft cron update
authored
61 export PROMPT_COMMAND='echo -ne "\033]0;${PWD/$HOME/~}\007"'
62
f736ae6 @gabesoft cron update
authored
63 # save bookmarks to folders
5f862ba @gabesoft cron update
authored
64 # save x = bookmarks the current directory as x
65 # cd x = navigates to the bookmarked path
66 # smarks = displays all bookmarks
67 # cmarks = clears all bookmarks
f736ae6 @gabesoft cron update
authored
68 if [ ! -f ~/.dirs ]; then # if doesn't exist, create it
69 touch ~/.dirs
70 fi
71
5f862ba @gabesoft cron update
authored
72 alias smarks='cat ~/.dirs'
73 alias cmarks='rm -f ~/.dirs; touch ~/.dirs'
f736ae6 @gabesoft cron update
authored
74 save (){
5f862ba @gabesoft cron update
authored
75 command sed "/!$/d" ~/.dirs > ~/.dirs1; \mv ~/.dirs1 ~/.dirs; echo "$@"=\"`pwd`\" >> ~/.dirs; source ~/.dirs ;
f736ae6 @gabesoft cron update
authored
76 }
77 source ~/.dirs # Initialization for the above 'save' facility: source the .sdirs file
78 shopt -s cdable_vars # set the bash option so that no '$' is required when using the above facility
79
5f862ba @gabesoft cron update
authored
80 # editor
81 export EDITOR='vim -f'
82
83 # history
84 export HISTCONTROL=ignoredups
85
86 # bash
87 bind "set completion-ignore-case on"
88 bind "set bell-style none"
89 bind "set show-all-if-ambiguous on"
90
91369a4 @gabesoft cron update
authored
91 # colors
92
93 # Black 0;30 Dark Gray 1;30
94 # Blue 0;34 Light Blue 1;34
95 # Green 0;32 Light Green 1;32
96 # Cyan 0;36 Light Cyan 1;36
97 # Red 0;31 Light Red 1;31
98 # Purple 0;35 Light Purple 1;35
99 # Brown 0;33 Yellow 1;33
100 # Light Gray 0;37 White 1;37
5f862ba @gabesoft cron update
authored
101
39ffca0 @gabesoft bash and vim settings
authored
102 export TERM=xterm-color
91369a4 @gabesoft cron update
authored
103 export GREP_OPTIONS='--color=auto'
104 export GREP_COLOR='1;31'
39ffca0 @gabesoft bash and vim settings
authored
105 export CLICOLOR=1
91369a4 @gabesoft cron update
authored
106 export LS_COLORS='di=0;36:fi=0;37:ln=0;35:pi=5:so=5:bd=5:cd=5:or=31:mi=1:ex=0;31:*.rb=90'
39ffca0 @gabesoft bash and vim settings
authored
107
108 export COLOR_NC='\033[0m' # No Color
109 export COLOR_WHITE='\033[1;37m'
110 export COLOR_BLACK='\033[0;30m'
111 export COLOR_BLUE='\033[0;34m'
112 export COLOR_LIGHT_BLUE='\033[1;34m'
113 export COLOR_GREEN='\033[0;32m'
114 export COLOR_LIGHT_GREEN='\033[1;32m'
115 export COLOR_CYAN='\033[0;36m'
116 export COLOR_LIGHT_CYAN='\033[1;36m'
117 export COLOR_RED='\033[0;31m'
118 export COLOR_LIGHT_RED='\033[1;31m'
119 export COLOR_PURPLE='\033[0;35m'
120 export COLOR_LIGHT_PURPLE='\033[1;35m'
121 export COLOR_BROWN='\033[0;33m'
122 export COLOR_YELLOW='\033[1;33m'
123 export COLOR_GRAY='\033[1;30m'
124 export COLOR_LIGHT_GRAY='\033[0;37m'
125
92b6ed4 @gabesoft cron update
authored
126 echo -e "${COLOR_WHITE}kernel info: " `uname -smr`
127 echo -e "${COLOR_BROWN}`bash --version`"
128 echo -ne "${COLOR_GRAY}uptime: "; uptime
129 echo -ne "${COLOR_GRAY}server time is: "; date
130 echo -ne "${COLOR_NC}"
Something went wrong with that request. Please try again.