Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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