Linux usage

  

Common usage:

export PATH=$PATH:/home/zhaodw

is better than modifying environment variables, but only valid in this login

Note: (in combination with shell variables)

1 = Pre-PATH variable without $ symbol

2 Additional path added: Append

Description: Set or display environment variables.

Syntax: export [-fnp][variable name]=[variable setting value]

Note: When executing a program in the shell, the shell provides a set of environment variables. Export can add, modify or delete environment variables for subsequent execution. The effectiveness of the export is only for this login operation.

Parameter:

-f stands for function name in [variable name].

-n Delete the specified variable. The variables are not actually deleted, they are not output to the execution environment of subsequent instructions.

-p List all the environment variables given to the program by the shell

The export setting environment variable is temporary, only valid in this login, you can modify the following files to make the command valid for a long time < Br>

1. Modify the profile file:

#vi /etc/profile

Add it to:

export PATH="$PATH:/opt/Au1200_rm/build_tools/bin"

This is shared by everyone on our machine. It is recommended not to modify this. Only modify the

under the root path. The second method

2. Modify the root path of this id. Bashrc or. Bash_profile file:

# vi /home/zhaodw/.bash_profile

Add it inside:

export PATH="$PATH:/opt/au1200_rm/build_tools/bin" ;

Note:

1. When the script is executed, it is run in a subshell environment. After the script is executed, the subshell will automatically exit;

2. In a shell System environment variables will be copied to the subshell (variables defined by export);

3, a system environment variable in a shell is only valid for the shell or its subshell, the shell ends The variable disappears (and cannot be returned to the parent shell).

4, variables that are not defined by export are only valid for the shell, and are not valid for the subshell.

Copyright © Windows knowledge All Rights Reserved