The value of path is a series of directories that Linux searches for when you run a program. You can see the value of path with the following command.
$ echo $PATH
For example, in a host, the user Yogin path value is:
/opt/kde/bin:/usr/local/bin:/bin:/usr/bin:/usr/x11r6/bin:/home/yogin/bin
where ":" is the separator. So, a list of directories above can be considered as the directory listing below.
/opt/kde/bin
/usr/local/bin
/bin:/usr/bin
/usr/X11R6/bin
/home/yogin/bin
Also, in the host, the path value for user root is:
/opt/kde/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/x11r6/bin:/root/bin
To modify the PATH value for all users, you can edit the/etc/profile file as root and modify the line that contains "path=".
For example, you can use the Pico Editor to open/etc/profile files.
$ pico-w/etc/profile
Pico is a text editor, and the-w option turns off long line wrapping functionality.
The new value for path will not take effect until the user registers again. If you only want to modify a user's path value, you should edit the. bash-profile file in the user's home directory.
If you want to add the current directory to the path, the. When you join the path, the path is set as follows:
Path= "$PATH:/usr/x11r6/bin:."
Export PATH
Note: After modifying the path value or any environment variable, export it with export and the new path value will not take effect.