16.4 Default User Settings

16.4 Default User Settings

The best way to write startup files and choose defaults for new users is to experiment with a new test user on the system. Create the test user with an empty home directory. Then, most importantly, refrain from copying your own startup files to the test user's directory. Write the new startup files from scratch.

When you think you have a working setup, log in as the new test user in all possible ways (on the console, remotely, and so on). Make sure that you test as many things as possible, including windowing system operation and manual pages. After you're happy with the test user, create a second test user, copying the startup files from the first test user. If everything still works fine, you now have a new set of startup files that you can distribute to new users.

The following sections outline reasonable defaults for new users.

16.4.1 Shell

The default shell for any new user on a Linux system should be bash. In the old days, the Bourne shell (sh) was more difficult to use in interactive mode than alternatives such as the C shell (csh), so users typically had a login shell that was different than the standard system shell. This changed when bash arrived on the scene, for it had all of the features of csh and its enhanced version (tcsh).

There are several good reasons for using bash on a Linux system:

  • Users interact with the same shell that they use to write shell scripts (csh is a notoriously bad scripting tool; please, don't even think about it).

  • bash is standard on Linux systems; tcsh is sometimes not.

  • bash uses GNU readline, and therefore, its interface is identical to many other tools. tcsh has a powerful command-line editing system, but it takes some time to learn.

  • bash gives you finer control over I/O redirection and file handles.

However, you can't teach an old dog new tricks, and many seasoned Unix wizards use csh and tcsh simply because they can't bear to switch. Of course, you can choose any shell you like, but my opinion is that you should choose bash if you don't have any preference, and you should also use bash as the default shell for any new user on the system (if they have another preference, they will be able to change their own shell with the chsh command).

Note?

There are plenty of other shells out there (rc, ksh, zsh, es, and so on). But just because they exist does not mean they are suitable beginner shells.

16.4.2 Editor

The default editor should be vi or emacs. These are the only editors virtually guaranteed to exist on nearly any Unix system, and they will therefore cause the least trouble in the long run for a new user.

As with shell startup files, avoid large default editor startup files. A little set showmatch in the vi .exrc startup file never hurt anyone, but steer clear of anything that significantly changes the editor's behavior or appearance, such as the showmode feature, autoindentation, and wrap margins.

16.4.3 Pager

It is perfectly reasonable to set the default PAGER environment variable to less, because it is very easy to use.