Saturday, August 18, 2012

FreeBSD C Shell Tricks

C shell is default shell for root account in FreeBSD. You can control settings through the following configuration files:

~/.cshrc - user specific settings
/etc/csh.cshrc - global settings

Color Prompt: display hostname in red color for shell prompt (read more here):
set prompt="%{\033[1;31m%}%m %{\33[34m%}%. %{\033[0m%}%# "
set promptchars = "%#"
or if above doesn't work:
alias setprompt 'set prompt="%{\033[1;31m%}`/bin/hostname -s` %{\33[34m%}$cwd:t %{\033[0m%}# "'
setprompt
alias cd 'chdir \!* && setprompt'
List directories in color:
alias ls        ls -G
Del Key In Terminal:
bindkey ^[[3~ delete-char

1 comment:

  1. Thanks for this:
    bindkey ^[[3~ delete-char

    ReplyDelete