FreeBSD Shell Settings

Source: Internet
Author: User
Tags resource

The command interpreter Shell is an application that is most closely related to users, and users use the system primarily through the shell. After each login to the system, a shell that interacts with the user is started, and the shell gives a prompt to wait for user input (SH is "$", CSH is "%", if the root is used, the login prompt will be "#"), and the user's input is interpreted.

There are two shells that can be used in FreeBSD's basic system: SH and CSH. These two basic shell styles are not quite the same, and different users often choose between them based on their preferences. Of course there are better shell programs available for users to choose from, these subsequent shells are based on SH or csh style further developed, so it can be said that in the shell, there are two styles, users need to choose according to their own use habits.

For administrators to set a basic environment for users who use different shells, you must understand the two styles of shell setup. When the system logs on, SH will first execute the/etc/profile file, setting the most basic environment for each user, and CSH will use/etc/csh.cshrc,csh.login and csh.logout as the System CSH resource file. After the system level login file is executed, each user's shell searches for the user's personal resource file under the user's home directory: SH uses. profile files, csh use. Login and. cshrc files. These resource files are used in the appropriate shell language,/etc/profile, and personal directories. Profile uses the SH-style control language,/ETC/CSHRC, and the personal directory. Login,. CSHRC uses CSH-style control language. System administrators can change these resource files to provide users with the most convenient use of the environment. Of course, the system administrator does not need to directly modify the personal home directory of the resource files, these files should be managed by the user, but the system administrator can generate the account when the user generated a default resource file, to ease the user to set the resource file trouble. The AddUser command defaults to using files under/usr/share/skel to provide users with default settings for various resource files, which can be put into other application resource files in addition to the Shell's resource files. Because these resource files are hidden files that start with a dot, in order to be clear, a conversion method is used in the Skel directory, such as using dot.profile as a template for. Profile.

# Ls/usr/share/skel

DOT.CSHRC dot.mail_aliases dot.rhosts

Dot.login DOT.MAILRC DOT.SHRC

Dot.login_conf Dot.profile

The default profile that is set for the user in/usr/share/skel does not affect the user after the user is generated. It is therefore more efficient and straightforward to modify the system login file. For SH-style users, you can change the/etc/profile file, and csh should change the/ETC/CSH.CSHRC file. In these files, you can alter the environment variables used by the shell to change the way the shell behaves, or to perform a series of automated actions that require automatic execution of some user logins.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.