Solved Terminal question

Hi,

I have noticed that in FreeBSD, the default terminal for the root user is csh and for other user the default is sh.

What is the main difference between the 2 terminals?
Why does normal user haven't got PS1 set to anything?

Thank you
Fred
 
I would suggest using tcsh(1) as the default for your users. It's mostly the same as csh(1) but has a few extra features. Both csh(1) and tcsh(1) are C shells. FreeBSD's sh(1) is based on Almquist Shell, which itself was based on the Bourne Shell. They're all shells but operate slightly different. I personally like the C-style syntax of the C-Shells, they're great for interactive use. Shell scripting should be done with sh(1). Other people prefer shells/zsh (a Korn Shell variant) or shells/bash (Bourne Again SHell; Another Bourne shell variant, commonly found on Linux).
 
SirDice
I set my user by running pw usermod <user> -s /bin/tcsh
Now, where is the file I can edit to add my aliases?
in csh for example, I set my alliases in ~/.cshrc but I cannot see a 'tcsh' version
 
tcsh(1) says:
FILES
/etc/csh.cshrc Read first by every shell. ...
/etc/csh.login Read by login shells after /etc/csh.cshrc. ...
~/.tcshrc (+) Read by every shell after /etc/csh.cshrc or its equivalent.
~/.cshrc Read by every shell, if ~/.tcshrc doesn't exist, after /etc/csh.cshrc or its equivalent. This manual
uses `~/.tcshrc' to mean `~/.tcshrc or, if ~/.tcshrc is not found, ~/.cshrc'.
So you can use ~/.cshrc or ~/.tcshrc
 
A neat trick you can use on the root account (if you use it for actual logins) is to copy the default /root/.cshrc to /root/.tcshrc. The csh(1) shell will then prefer the /root/.tcshrc file over the other one and you can customize /root/.tcshrc as you like and leave /root/.cshrc unmodified (saving some time on system upgrades because /root/.cshrc is actually under mergemaster(8) control).
 
Back
Top