The
When you enter a command in the terminal, the system searches through these directories in the order they are listed in the
This allows you to run programs and scripts without needing to specify their full file paths.
PATH
environment variable on Linux (or macOS) is a system variable that specifies a set of directories where executable programs are located.When you enter a command in the terminal, the system searches through these directories in the order they are listed in the
PATH
to find the executable file for the command. This allows you to run programs and scripts without needing to specify their full file paths.
To display the directories in the PATH
environment variable on a macOS, each on a new line, you can use the following command in the terminal:
echo $PATH | tr ':' '\n'
This command uses tr
to translate the colon :
separators into newline characters \n
, effectively breaking the PATH
into distinct lines for each directory.
Author : Kevin Kouomeu
I hope you enjoyed reading this, and I'm curious to hear if this tutorial helped you. Please let me know your thoughts below in the comments. Don't forget to subscribe to my newsletter to avoid missing my upcoming blog posts.
You can also find me here LinkedIn • Twitter • GitHub or Medium
I hope you enjoyed reading this, and I'm curious to hear if this tutorial helped you. Please let me know your thoughts below in the comments. Don't forget to subscribe to my newsletter to avoid missing my upcoming blog posts.
You can also find me here LinkedIn • Twitter • GitHub or Medium