The path value is a series of directories. When you run a program, Linux searches for these directories and uses the following command to set the path value.
Use the Export command directly
Add the/data/test/Hellow. Sh script to the path so that the script can be executed in other directories. [Root @ localhost/] # cd/data/test
[Root @ localhost test] # ll
Total usage 4
-Rwx ------ 1 Root 32 October 25 13:02 Hellow. Sh
[Root @ localhost test] # echo $ path
# Show $ PATH variables
/Usr/Kerberos/sbin:/usr/Kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin: /usr/bin:/usr/x11r6/bin:/root/bin
[Root @ localhost test] # cd/
[Root @ localhost/] # export Path =/data/test: $ path
# Add the script path to $ path
[Root @ localhost/] # export | grep Test
# View $ path
Declare-x oldpwd = "/data/test"
Declare-XPath = "/data/test :/
Usr/Kerberos/sbin:/usr/Kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin: /usr/bin:/usr/x11r6/bin:/root/bin"
Modify Profile File
[Root @ localhost/] # vi/etc/profileexport path user LOGNAME mail hostname histsize inputrc
# Join
Modify the. Bash File
[Root @ localhost/] # vi/root/. bashrc
#. Bashrc
# User specific aliases and functions
Alias Rm = Rm-I
Alias CP = CP-I
Alias mv = MV-I
# Source Global definitions
If [-F/etc/bashrc]; then
./Etc/bashrc
Fi
Export Path = "$ path:/data/test /"