Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- ! ((UID)) && echo -e "\n\e[1;31m"' (!) '"Dont use 'sudo'\e[m\n" && exit 1
- echo -e "\e[33m Creating backup...\e[m"
- mv ~/.bashrc ~/.bashrc.bak 2>/dev/null
- sudo mv /root/.bashrc /root/.bashrc.bak 2>/dev/null
- sleep 0.5 && echo -e "\e[33m Creating new bashrc...\e[m"
- echo '# ,___
- # ¡ _`
- # ª_/() .bashrc
- # |\` `, http://pastebin.com/u/noes1s
- # _· l
- ### If not running interactively, stop
- [[ -z "$PS1" ]] && return
- ### Extract file, example. "ex package.tar.bz2"
- ex() {
- if [[ -f $1 ]]; then
- case $1 in
- *.tar.bz2) tar xjf $1 ;;
- *.tar.gz) tar xzf $1 ;;
- *.bz2) bunzip2 $1 ;;
- *.rar) rar x $1 ;;
- *.gz) gunzip $1 ;;
- *.tar) tar xf $1 ;;
- *.tbz2) tar xjf $1 ;;
- *.tgz) tar xzf $1 ;;
- *.zip) unzip $1 ;;
- *.Z) uncompress $1 ;;
- *.7z) 7z x $1 ;;
- *) echo $1 cannot be extracted ;;
- esac
- else
- echo $1 is not a valid file
- fi
- }
- ### Directory navigation aliases
- alias ..="cd .."
- alias ...="cd ../.."
- alias ....="cd ../../.."
- alias .....="cd ../../../.."
- ### Don not put duplicate lines in the history
- HISTCONTROL=ignoredups:ignorespace
- ### Resize terminal if necesary
- shopt -s checkwinsize
- ### Add more colors
- [[ -x /usr/bin/dircolors ]] && {
- test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
- alias ls="ls --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"
- }
- ### Add more aliases
- alias ll="ls -alF"
- alias la="ls -A"
- alias l="ls -CF"
- alias upd="sudo apt-get update"
- alias upg="sudo apt-get upgrade"
- alias ins="sudo apt-get install"
- alias rem="sudo apt-get purge"
- alias fix="sudo apt-get install -f"
- ### Prompt
- ((UID)) &&
- PS1="\[\e[1;32m\]\u\[\e[0;34m\]@\h\[\e[0;37m\]\w\[\e[1;32m\]\\$\[\e[m\] " ||
- PS1="\[\e[1;31m\]\u\[\e[0;34m\]@\h\[\e[0;37m\]\w\[\e[1;31m\]\\$\[\e[m\] "
- ' > ~/.bashrc &&
- sudo cp ~/.bashrc /root/.bashrc &&
- echo -e "\e[32m New bashrc created.\e[m" &&
- bash
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement