To display or echo the PATH
environment variable in Linux/UNIX/*BSD, you can use the echo
command in the terminal. The PATH
variable contains a colon-separated list of directories that the system searches for executables.
Here are the steps to display the PATH
variable:
- Open a terminal window.
- Type the following command:
echo $PATH
This will display the value of the
PATH
variable on your system.
If you want to see the directories in the PATH
variable listed one per line, you can use the tr
command to replace the colons with newlines:
echo $PATH | tr ':' '\n'
This will display the directories in the PATH
variable, one per line.