关于freebsd 命令提示符()[还有一些其他的设置]

来源:互联网 发布:手机淘宝怎样充话费 编辑:程序博客网 时间:2024/04/27 16:18

/etc/csh.cshrc


#设置提示符

set prompt = '[%B%n@%m%b] %B%~%b%# '


#查看io使用的方法

systat -vmstat 1

top -mio


# $FreeBSD$
#
# System-wide .cshrc file for csh(1).


# pretty path
set path = ( ~/bin /bin /usr/local/bin /usr/local/sbin /usr/bin /sbin \
             /usr/sbin /usr/X11R6/bin /usr/local/jdk1.3.1/bin \
           )


if ( -d "/usr/games" ) set path = ( $path /usr/games )
if ( -d "/usr/ports" ) set path = ( $path /usr/ports/Tools/scripts )
if ( -d "/var/qmail" ) set path = ( $path /var/qmail/bin )
if ( -d "/home/des/bin" ) set path = ( $path /home/des/bin )


# settings
set autocorrect                 # fix my mistakes.
set autolist = ambiguous        #
set cdpath = ( ~ )              # lazy
set complete = enhance          # vi f.b completes to foo.bar!
set correct = cmd               # correct what i type.
set filec                       # file completion
set prompt = '[%B%n@%m%b] %B%~%b%# '
set history = 5000              # history buffer
set notify                      # don't wait for activity; instant job status
set watch=(0 any any)           # who's here?
unset autologout                # idle.
unset noglob                    # 


# environment setup
setenv PAGER            "less"
setenv LSCOLORS ExGxFxdxCxegedabagExEx 
setenv  LANG    zh_CN.UTF-8
setenv  LC_ALL  zh_CN.UTF-8


if ( -d "~/tmp" ) setenv TMPDIR "$HOME/tmp"     # secure.


if (! $?term) exit              # if we don't have a terminal, bail.


# nifty prompt.  xterm title if we're in an xterm...
switch ($term)
case "aterm":
case "rxvt":
case "screen":
case "xterm":
case "xterm-color":
    setenv TERM xterm
    set xterm="%{\033]2;%n@%m:%~\007%}%{\033]1;%m\007%}"
    breaksw
default:
    set xterm=""
endsw


unset xterm


# aliases because I am lazy
alias   \!              'h'
alias   c               'clear'
alias   dist.cshrc      'xapply "scp .cshrc %1:." `cat .hosts`'
alias   dosort          'sort -o \!* \!*'
alias   eg              'egrep'
alias   f               'find . -name \!* -print'
alias   ff              'find . -name \!* -exec ls -l {} \;'
alias   g               'grep'
alias   h               'history'
alias   j               'jobs -l'
alias   l               'less'
alias   ll              'ls -Fla'
alias   lld             'ls -Fald'
alias   ls              'ls -GFa'
alias   m               'make'
alias   mq              'mailq'
alias   mqg             'mailq | grep \!*'
alias   newhost         'xapply "scp %1 \!*\:." .ssh/authorized_keys .cshrc'
alias   r               'rehash'
alias   res             'source ~/.cshrc'


set psargs = "-auwx"
set psargs2 = "-ux"


alias   psa             'ps $psargs'
alias   psx             'ps $psargs2'
alias   psg             'ps $psargs | grep \!* | grep -v grep'


# cool autocomplete goodness


# this has a tab completion for hosts. yay!
set hosts
set noglob
foreach f ($HOME/.hosts $HOME/.rhosts)
  if ( -r $f ) then
    set hosts = ($hosts `grep -v "+" $f | tr -s " " "   " | cut -f 1`)
  endif
end


# more complete loving.
complete -%*            c/%/j/
complete {alias,unalias}        p/1/a/
complete {bg,fg,stop}   c/%/j/ p/1/"(%)"//
complete cat            n/*/f/
complete cd             p/1/d/
complete chgrp          c/-/"(c f h R v -)"/ n/-/g/ p/1/g/ n/*/f/
complete chown          c/-/"(c f h R v -)"/ C@[./\$~]@f@ c/*[.:]/g/ \
                        n/-/u/. p/1/u/. n/*/f/
complete exec           p/1/c/
complete ftp            c/-/"(d i g n v)"/ n/-/\$hosts/ p/1/\$hosts/ n/*/n/
complete finger         c/*@/\$hosts/ n/*/u/@ 
complete kill           'c/-/S/' 'c/%/j/' \
                        'n/*/`ps -xu $LOGNAME | awk '"'"'{print $2}'"'"'`/'
complete {killall,pkill}        c/-/S/ n/*/c/
complete make           'n/-f/f/' 'c/*=/f/' \
                        'n@*@`cat -s GNUmakefile Makefile makefile |& sed -n -e "/No such file/d" -e "/^[^     #].*:/s/:.*//p"`@'
complete mutt           c@=@F:$HOME/Mail/@
complete ping           p/1/\$hosts/
complete {portupgrade,pkg_delete,pkg_info}      c/-/"(f x)"/ p@*@D:/var/db/pkg@@
complete rmdir          n/*/d/
complete set            'c/*=/f/' 'p/1/s/=' 'n/=/f/'
complete ssh            p/*/\$hosts/ c/-/t/ n/-l/u/
complete sudo           n/-l/u/ p/1/c/
complete sysctl         'n/*/`sysctl -Na`/'
complete talk           p/1/'`users | tr " " "\012" | uniq`'/ \
                        n/*/\`who\ \|\ grep\ \$:1\ \|\ awk\ \'\{\ print\ \$2\ \}\'\`/
complete telnet         p/1/\$hosts/ p/2/x:'<port>'/ n/*/n/
complete traceroute     p/1/\$hosts/
complete unset          n/*/s/
#complete vi            p/1/t/
complete which          n/*/c/
complete xhost          c/[+-]/\$hosts/ n/*/\$hosts/
complete xpdf           n/*/f:*.pdf/
unset noglob


bindkey -k up history-search-backward
bindkey -k down history-search-forward
bindkey "^W" backward-delete-word

原创粉丝点击