Linux basic user environment

Source: Internet
Author: User
Basic Linux User Environment-general Linux technology-Linux technology and application information. For more information, see the following section. Home Directory
The location of the Home directory in the file system is/home/username. username is the user name you used to log on to the system. There is a $ HOME environment variable, which stores the PATH value. You can enter cd $ HOME in the shell to directly enter the HOME directory of the current user.

You have full write permission on $ HOME.

/Etc/skel
The folder name comes from skeleton. It indicates the skeleton, because it contains the basic file and directory structure of a user directory.

By default, when you create a user directory, the system will copy the content in the/etc/skel directory to your user directory. all files in this directory are hidden files (the file name is ". files), so after copying them to your HOME directory, you will not directly see them.

Can you use ls on a virtual terminal? A/etc/skel to View these Files, or View> Show Hidden Files in nautilus (the default shortcut for this operation is Ctrl + H.

Here are some typical files:

. Bash_logout

When you exit bash, the code in the modified file will be executed. For example, when you exit, you may want to clear the screen (execute the clear command)

. Bashrc

The basic bash configuration file generally contains references to the/etc/bashrc file. Check the code in the file:



if [ -f /etc/bashrc ]; then

. /etc/bashrc

fi



The if statement determines whether/etc/bashrc exists and whether it is a problem (rather than a directory or something). if yes, execute the command.

Here you can also Customize What to execute when bash is started. A typical example is to set an alias such as rm = 'rm? Rf'

. Bash_profile

Configure the Bash startup environment variable here. Of course, you can also directly set the bash environment variable using the export command in bash, but the export command can only be used for one current bash instance, and if you are in. the settings in bash_profile are permanent.

There are other files, such. emacs and. zshrc: the former is the configuration file of emacs, and the latter is the configuration file of z shell. the kde directory contains kde configuration information. the specific configuration files vary depending on the utilities you have installed. For example, if you have not installed the kde Desktop Environment. kde directory.

This involves a small trick. After a new user is created, the system will copy the files in the/etc/skel directory to the user's home directory, then, we can use it to add information to/etc/skel that we want to distribute to new users. For example, you may have some precautions for new users who want to use the system, you can upload a readme.txt file in/etc/skel.
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.