海神


配置shell

2005-08-11

cd ~ 或cd 进入用户主目录
ls
.cshrc      .klogin       .login     .profile

编辑.cshrc文件

# $FreeBSD: src/etc/root/dot.cshrc,v 1.25.2.2 2001/03/05 13:36:53 asmodai Exp $
#
# .cshrc - csh resource script, read at beginning of execution by each shell
#
# see also csh(1), environ(7).
#

# Change the 'rm' (remove) command to interactive mode for safety:
alias rm        'rm -i'

# Copy (i)nteractively with a prompt before overwriting:
alias cp        'cp -i'

# Move or Rename (i)nteractively with a prompt before overwriting:
alias mv        'mv -i'

# LiSt files with Largest first:
alias lsl       'ls -AblprtFT | sort -n +4 -r | more'

# LiSt files with Smallest shown first:
alias lss       'ls -AblprtFT | sort -n +4 | more'

# LiSt files with the newly modified (Time) shown first:
alias lsn       'ls -AblprtFT | more'

# LiSt files with the newly modified (Time) shown last:
alias lso       'ls -AblptFT | more'

# LiSt files sorted by name:
alias ll        'ls -AblptFT | sort +9 | more'

# An alias for mounting a MS-DOS floppy disk:
alias mflop     'mount -t msdos /dev/fd0 /floppy'

# An alias for unmounting a floppy disk:
alias uflop     'umount /floppy'

# An alias for mounting a CD-ROM disk:
alias mcd       'mount -t cd9660 /dev/acd0c /cdrom'

# An alias for unmounting a CD disk:
alias ucd       'umount /cdrom'

# Remove a subdirectory and EVERYTHING it contains, (i)nteractively:
alias deltree   'rm -dirv'

# Show the last 25 commands entered:
alias h  'history 25'

# Show the status of tasks that you typed in on the command line:
alias j  'jobs -l'

# A righteous umask
umask 22

set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin /usr/X11R6/bin $HOME/bin)

setenv EDITOR pico
setenv PAGER more
setenv BLOCKSIZE K

if ($?prompt) then
 # An interactive shell -- set some stuff up
 set prompt = "%B%n@%M[%/]" //%B粗体字,%n用户名,%M机器名,%/当前路径
 set filec
 set history = 100
 set savehist = 100
 set mail = (/var/mail/$USER)
 if ( $?tcsh ) then
  bindkey "^W" backward-delete-word
  bindkey -k up history-search-backward
  bindkey -k down history-search-forward
 endif
endif

建立目录/floppy,/cdrom,新建两个文件
touch /floppy/Floppy-NOT-mounted-mflop.txt
touch /cdrom/CD-is-NOT-mounted-mcd.txt

保存,然后Ctrl+D,退出当前登陆,重新登陆后显示:
root@chu888[/root]


blog comments powered by Disqus