Article Title: basic user environment of Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
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 permissions on $ HOME.
/Etc/skel
The folder name comes from skeleton, which 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 copies 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
Basic bash configuration file, which generally contains references to the/etc/bashrc file. Let's look at the Code:
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. The settings in bash_profile are permanent.
There are other files, such. Emacs and. Zshrc: the former is the configuration file of emacs, the latter is the configuration file of z shell, and so on. 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.