1. Skip to Menu
  2. Skip to Content
  3. Skip to Footer>
Thursday May 2nd     4:02 PM PDT                                  

Configure C-Shell (CSH)

Written by Greg King Friday, 03 July 2009 14:34

In FreeBSD, a lot of everyday work is done in a command line interface called a shell. A shell's main job is to take commands from the input channel and execute them. A lot of shells also have built in functions to help with everyday tasks such as file management, file globbing, command line editing, command macros, and environment variables. FreeBSD comes with a set of shells, such as sh, the Bourne Shell, and tcsh, the improved C-shell. Many other shells are available from the FreeBSD Ports Collection, such as zsh and bash.

 

In this example we will first configure the CSH shell and then later we will download and configure the zsh shell.


Configuring CSH shell

Backup the default csh.cshrc file and create a new one with the following:

# mv /etc/csh.cshrc /etc/csh.cshrc.sample
# nano /etc/csh.cshrc

notice: in the cut / paste below, the lines that start with a # are comments.  You want to paste them into the document!  Don't enter those at the command prompt!

------START CUT & PASTE BELOW-----------------------------------------------------------------

# $FreeBSD: src/etc/csh.cshrc,v 1.3 1999/08/27 23:23:40 peter Exp $
#
# System-wide .cshrc file for csh(1).
alias h         history 25
alias j         jobs -l
alias la        ls -a
alias lf        ls -FA
alias ll        ls -lA
alias df        df -h
# A righteous umask
umask 22
set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin $HOME/bin)
setenv  EDITOR  nano
setenv  PAGER   more
setenv  BLOCKSIZE       K
if ($?prompt) then
        # An interactive shell -- set some stuff up
        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
set prompt="%S %T %B %m %b%s %n %~ ->"

-----------STOP CUT & PASTE ABOVE-------------------------------------------------------------

paste the above text into your the nano screen and save it.

Update the user database with this.

# chsh -s /bin/csh

exit your current su, and then go back to su

# exit

> su - root

and your prompt should have changed to be much more helpful!

# echo $SHELL

confirms which shell is current.

# less /etc/shells

shows which shells are install on the system.

  FreeBSD Configuration
eXTReMe Tracker
Content View Hits : 404998