Home Directory
The location of the Home directory in the file system is /home/username. username is the username when you log in 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 current user's home directory.
The user has full write access to $HOME.
/etc/skel
The name of this folder comes from skeleton, which means skeleton, because it contains the basic files and directory structure of a user directory.
By default, when you create a user directory, the system will copy the contents of the /etc/skel directory to your user directory. The files in this directory are hidden files (the file names begin with "." files starting with ), so you will not see them directly after copying them to your HOME directory.
You can use ls –a /etc/skel to view these files in the virtual terminal, or view them in View->Show Hidden Files in nautilus (the default shortcut key 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, you may want to clear the screen (execute the clear command) when exiting.
.bashrc
The basic bash configuration file usually contains a reference to the /etc/bashrc file. Take a 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 else), and if so, executes the commands in it.
Here you can also customize what to do when starting bash. A typical example is to set an alias such as rm='rm –Rf'
.bash_profile
Configuring the Bash startup environment variables is here. Of course, you can also use the export command to set the bash environment variables directly in bash, but the export command can only target an instance of the current bash, and if you set it in .bash_profile, permanent.
There are also other files, such as .emacs and .zshrc. The former is the configuration file of emacs, the latter is the configuration file of z shell, and the .kde directory contains kde configuration information, etc. There are also some specific What kind of configuration files will vary depending on the utilities you install. For example, if you do not install the kde desktop environment, there will be no .kde directory.
A little trick is involved here. Since the system will copy the files in the /etc/skel directory to the user's home directory after creating a new user, we can also use it to add some files to /etc/skel that we want to distribute to the new user. User information, for example, you may have some notes for every new person who uses this system, you can add a Readme.txt in /etc/skel