IE
Home arrow Blog arrow Linux arrow The .cshrc file
The .cshrc file Print Email
Written by Nick Yeoman   
Sunday, 25 March 2007

This article is an example .cshrc file.


# Set path shell variable
# (See description of path in the paragraph followin this example .cshrc)
set path = ( . ~ /usr/local/bin /usr/bin /etc \bin )

# Don't overwrite existing files
set noclobber

# Don't create core dump files when a program blows up.
limit coredumpsize 0

# Check to see if this is an interactive shell.
# If not, skip the rest of this file.
if ($?USER == 0 || $?prompt == 0) exit

## Set C shell variables
# Remember my 32 most recent events
set history=32

# Save the most recent 40 events when I log out
set savehist=40

# Turns on file completion so you can use Esc to complete filenames
set filec

# Tells the shell to ignore .o files when trying to complete filenames
# when filec is set. (This doesn't hold if the .o file is the only
# on that could be completed.
set fignore=.o

# Tells "filec" not to cry if it can't complete a file.
set nobeep

# Notify me when the status of background jobs change
set notify

# Don't let me log out by pressing
set ignoreeof

# Set TTY shell variable equal to the current terminal name
set TTY=`who am i | awk '{print $2}'`

# Allow others to send messages directly to my terminal
mesg y


# Set prompt to have the following form: [cmd#]cpu[directory]:
set cpu=`hostname | awk '{FS = "."; print $1}'` # set cpu = computer name
alias sp set prompt='\[!\]$cpu\[$cwd\]:\ ' # set sp to set the prompt
alias cd 'chdir \!* ; sp' # redefine cd command
alias pd 'pushd \!* ; sp' # redefine pd command
alias pp 'popd \!* ; sp' # redefine pp command
sp # set the prompt

# Shortcut aliases
alias c 'clear'
alias dict 'vi /usr/dict/words'
alias gv 'ghostview'
alias h 'history !* | head -39 | more'
alias laser 'lpr -Pmsa13 -h'
alias line 'lpr -Ped3'
alias ll 'ls -la'
alias ls 'ls -x'
alias mine 'chmod og-rwx'
alias pwd 'echo $cwd' # This is faster than executing the pwd command
alias safe 'chmod a-w'
alias tmp 'cd /tmp/taylor'

Last Updated ( 2007-07-27 19:16:05 )