Showing posts with label shell. Show all posts
Showing posts with label shell. Show all posts

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

FreeBSD Bourne Shell Tricks

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

~/.shrc - user specific settings
/etc/profile - global settings

Color Prompt: display hostname in green color for shell prompt (read more here):
# vi ^[: ctrl+v and then Esc
#PS1="^[[32m$^[[0m "
PS1="^[[1;32m`whoami`@\h ^[[34m\W ^[[0m$ "
List directories in color:
alias ls='ls -G'
Color case insensitive grep:
export GREP_OPTIONS='-i --color=auto'