Setting the shell prompt to something useful

Posted Sunday, March 6th 2011 in FreeBSD - Permalink

By default, the shell prompts in FreeBSD aren’t very helpful. The default root shell is csh, and only shows the hostname and the root shell prompt “#”.

To make it more useful, enter the following into ~/.cshrc:

set prompt = "%b[%n] %~ %# "

Browse through the rest of the file to make sure that there is not another set prompt that will override this. This change will show a prompt with the current username and working directory, as well as root access prompt, such as

[root] /usr/ports #

Also, I like ls to show colours, so that directories, executables, etc., are easier to see. Again, type the following into ~/.cshrc:

alias ls ls -LG

List Posts Newest Posts Page 1Next Page