/etc/profile : The first file used by the operating system to customize the user environment when logging in, this file is each of the system The user sets the environment information, which is executed when the user logs in for the first time.
/etc /environment : The second file used by the operating system when logging in. The system sets the environment variables of the environment file before reading your own profile.
~/.profile : The third file used during login is the .profile file. Each user can use this file to enter the shell information dedicated to their own use. When the user logs in, the file is used. Execute only once! By default, he sets some environment variables and executes the user's .bashrc file.
/etc/bashrc : Execute this file for each user running the bash shell. This file is read when the bash shell is opened.
~/.bashrc : This file contains The bash information that is specific to your bash shell, which is read when you log in and each time you open a new shell.
Setting method of PASH environment variable:
Method 1: The .profile or .bashrc file in the user's home directory (recommended)
Log in to your user (non-root ), in the terminal input:
$ sudo gedit ~/.profile(or .bashrc)
You can add the PATH settings at the end of this file as follows:
export PATH= & rdquo;$PATH:your path1:your path2 …”
Save the file, log out and log in, the variable takes effect.
The variables added in this mode are only valid for the current user.
Method 2: Profile file in the system directory (cautious)
In the system's etc directory, there is a profile file, edit the file:
$ sudo gedit /Etc/profile
The settings for adding PATH at the end are as follows:
export PATH=”$PATH:your path1:your path2 …”
After restarting the system, the variables take effect.
The variables added in this way are valid for all users.
Method 3: Environment file under the system directory (cautious)
In the system's etc directory, there is an environment file, edit the file:
$ sudo gedit /Etc/environment
Locate the following PATH variable:
PATH=”<……>”
Modify the PATH variable and include yourself in it The path can be, for example:
PATH=”<……>:your path1:your path2 …”
Each path is separated by a colon. The file is also restarted and affects all users.
Note that this is not to add export PATH=…
Method 4: Enter directly under the terminal
$ sudo export PATH=”$PATH:your path1:your path2 …”
Effective, but the settings become invalid after the user logs out or the system restarts, suitable for the setting of temporary variables.
Note: The modifications of methods 2 and 3 need to be cautious, especially through the root user. If the modification is wrong, it may cause some serious system errors. Therefore, I recommend using the first method. In addition, the development of embedded Linux is best not to be done under root (unless you are already familiar with Linux!!), so as to avoid serious system errors caused by improper operation.
. Using a Linux terminal is more than just entering commands. After learning these basic techniques,
Compiled linux kernel has been 3 times, each compilation needs to go online to find the compilation
Ubuntu is a good Linux operating system, but for newcomers who just installed it, how to connect to
The companys network environment is a bit complicated, and the damn secure policy requires
Detailed Linux-command information
Linux tutorial - view the process ps, top
Sudo command in Linux system to explain
Vim repair, telnet installation start, linux update software source
Linux no password ssh login (commonly known as open)
How to view the run level in Linux system
Dr mode configuration script in lvs
How to solve the problem of Win10 folder icon background turning black?
How to turn demo mode on or off in Win8
How does Win7 change the color scheme? Change the Windows 7 color scheme tutorial
Where is the Win8/Win8.1 logout option? How to log out?
Teaching the steps of special characters with the best five-stroke input method
Windows 7 backup and recover Graphic tutorial
Microsoft: Windows 8 supports free switching between desktop and tablet interfaces
Customized for Win9, Microsoft's next generation IE12 new features foresight