removido
(usa Nenhuma)
Enviado em 20/02/2011 - 11:16h
$ sudo chmod 777 $HOME/.bashrc
e cola como exemplo meu .bashrc:
# ~/.BASHRC PERSONALIZADO.
complete -cf sudo
shopt -s cdspell
shopt -s checkwinsize
shopt -s cmdhist
shopt -s dotglob
shopt -s expand_aliases
shopt -s extglob
shopt -s histappend
shopt -s hostcomplete
shopt -s nocaseglob
export HISTSIZE=10000
export HISTFILESIZE=${HISTSIZE}
export HISTCONTROL=ignoreboth
alias ls='ls --group-directories-first --time-style=+"%d.%m.%Y %H:%M" --color=auto -F'
alias ll='ls -l --group-directories-first --time-style=+"%d.%m.%Y %H:%M" --color=auto -F'
alias la='ls -la --group-directories-first --time-style=+"%d.%m.%Y %H:%M" --color=auto -F'
alias grep='grep --color=tty -d skip'
alias cp="cp -i"
alias df='df -h'
alias free='free -m'
# ex - archive extractor
# usage: ex <file>
ex ()
{
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar 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 via ex()" ;;
esac
else
echo "'$1' is not a valid file"
fi
}
# prompt
PROMPT_COMMAND='history -a;echo -en "{TTEXTO}33[m{TTEXTO}33[38;5;2m"$(( `sed -nu "s/MemFree:[\t ]\+\([0-9]\+\) kB/\1/p" /proc/meminfo`/1024))"{TTEXTO}33[38;5;22m/"$((`sed -nu "s/MemTotal:[\t ]\+\([0-9]\+\) kB/\1/Ip" /proc/meminfo`/1024 ))MB"\t{TTEXTO}33[m{TTEXTO}33[38;5;55m$(< /proc/loadavg){TTEXTO}33[m"'
PS1='\[\e[m\n\e[1;30m\][$$:$PPID \j:\!\[\e[1;30m\]]\[\e[0;36m\] \T \d \[\e[1;30m\][\[\e[1;34m\]\u@\H\[\e[1;30m\]:\[\e[0;37m\]${SSH_TTY} \[\e[0;32m\]+${SHLVL}\[\e[1;30m\]] \[\e[1;37m\]\w\[\e[0;37m\] \n($SHLVL:\!)\$ '
# colors
export black="\[{TTEXTO}33[0;38;5;0m\]"
export red="\[{TTEXTO}33[0;38;5;1m\]"
export green="\[{TTEXTO}33[0;38;5;2m\]"
export yellow="\[{TTEXTO}33[0;38;5;3m\]"
export blue="\[{TTEXTO}33[0;38;5;4m\]"
export magenta="\[{TTEXTO}33[0;38;5;55m\]"
export cyan="\[{TTEXTO}33[0;38;5;6m\]"
export white="\[{TTEXTO}33[0;38;5;7m\]"
export coldblue="\[{TTEXTO}33[0;38;5;33m\]"
export smoothblue="\[{TTEXTO}33[0;38;5;111m\]"
export iceblue="\[{TTEXTO}33[0;38;5;45m\]"
export turqoise="\[{TTEXTO}33[0;38;5;50m\]"
export smoothgreen="\[{TTEXTO}33[0;38;5;42m\]"
# enable color support of ls and also add handy aliases
eval `dircolors -b`
alias ls='ls --color=auto'
alias dir='ls --color=auto --format=vertical'
alias vdir='ls --color=auto --format=long'
# some more ls aliases
alias ll='ls -lhX'
alias la='ls -A'
alias ldir='ls -lhA |grep ^d'
alias lfiles='ls -lhA |grep ^-'
alias l='ls -CF'
# To see something coming into ls output: lss
alias lss='ls -lrt | grep $1'
# To check a process is running in a box with a heavy load: pss
alias pss='ps -ef | grep $1'
# usefull alias to browse your filesystem for heavy usage quickly
alias ducks='ls -A | grep -v -e '\''^\.\.$'\'' |xargs -i du -ks {} |sort -rn |head -16 | awk '\''{print $2}'\'' | xargs -i du -hs {}'
# cool colors for manpages
alias man="TERMINFO=~/.terminfo TERM=mostlike LESS=C PAGER=less man"
# nano como editor padrão!!!
export EDITOR=nano
export VISUAL=nano
alias editor=nano
alias vi=nano
# moc
alias music='mocp -m /media/sda8/MUSIC/'
alias killmoc='killall mocp'
# editar sources.list.
alias editlists='sudo leafpad /etc/apt/sources.list'
# atualizar listas de pacotes.
alias atualizar='sudo apt-get update'
# atualização básica do sistema.
alias upgrade='sudo apt-get upgrade'
# atualização completa do sistema.
alias distupgrade='sudo apt-get dist-upgrade'
# instalar pacote com o APT.
alias instalar1='sudo apt-get install'
# descarta a instalação de pacotes recomendados ou sugeridos
alias instalar2='sudo apt-get --no-install-recommends install'
# descarta a instalação de pacotes recomendados ou sugeridos
alias instalar3='sudo aptitude install'
# descarta a instalação de pacotes recomendados ou sugeridos
alias instalar4='sudo aptitude --without-recommends install'
# instalar pacote com o DPKG.
alias dpkginst='sudo dpkg -i'
# remover pacote com o APT.
alias remover='sudo apt-get remove'
# remover pacote com o DPKG.
alias dpkgrmv='sudo dpkg -r'
# remover pacote e configurações.
alias aptprg='sudo apt-get remove --purge'
# remover pacotes órfãos.
alias autoremove='sudo apt-get autoremove'
# remover pacote órfãos e configurações.
alias aptautprg='sudo apt-get autoremove --purge'
# remover pacotes antigos do cache.
alias autoclean='sudo apt-get autoclean'
# procurar pacote.
alias aptsearch='sudo apt-cache search'
# mostrar pacote.
alias aptshow='sudo apt-cache show'
# reparar APT/DPKG:
alias aptrepair='sudo apt-get -f install'
alias dpkgrepair='sudo dpkg --configure -a'
# reconfigurar pacote:
alias dpkgreconf='sudo dpkg--reconfigure'
# preligar binários:
alias preligar='sudo prelink --all'
# atualizar índices com o updatedb:
alias index='sudo updatedb'
# pings:
alias google='ping -i 3
www.google.com';
alias globo='ping -i 3
www.globo.com';
alias uol='ping -i 3
www.uol.com.br';
alias yahoo='ping -i 3
www.yahoo.com';
# processos:
alias processo='ps -aux | grep '
alias matar='sudo kill -9 '
alias finalizar='sudo killall '
# Rádios OnLine:
alias kissfm='mplayer -playlist "http://www.crosshost.com.br/cbs/kiss/ouvir.m3u"'
alias kissfm2='mplayer -playlist
http://www.crosshost.com.br/cbs/kiss/radio.asx';
alias metalmilitia='mplayer -playlist "http://www.server1.bouncestream.com.br/tunein.php/metal/playlist.pls"'
alias globoamsp='mplayer
http://wm-sgr-live.globo.com/sgr_off_globoamsp_live.wma';
alias cbnfmsp='mplayer
http://wm-sgr-live.globo.com/sgr_off_cbnfmsp_live.wma';
alias bandamsp='mplayer
http://servidor25.crossdigital.com.br:8000/bandeirantesam';
# Image Shadow.
image-shadow () {
out=${1%.*}-shadow.${1#*.}
in=$1
echo "Converted file : $out"
if [ ! -z $2 ] ; then
convert $in -frame $2 $out
in=$out
fi
convert $in \( +clone -background black -shadow 60x5+10+10 \) \
+swap -background white -layers merge +repage $out
}
# apt-history
function apt-history(){
case "$1" in
install)
cat /var/log/dpkg.log | grep 'install '
;;
upgrade|remove)
cat /var/log/dpkg.log | grep $1
;;
rollback)
cat /var/log/dpkg.log | grep upgrade | \
grep "$2" -A10000000 | \
grep "$3" -B10000000 | \
awk '{print $4"="$5}'
;;
*)
cat /var/log/dpkg.log
;;
esac
}
# bash_completion
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
. /etc/bash_completion
fi
# Mapa de Teclado
setxkbmap -model abnt2 -layout br -variant abnt2