echo "${PATH//:/\\n}"
${PATH//:/\\n}
replaces all :
with a newline character, so simply by printing the result, we can see each entry on its own line.
This can be useful for example to find if something is in your PATH
or not with grep
, or to check if you have duplicates that might be worth cleaning up.