kuda.ai

Thoughts on programming and music theory.

Pretty Print $PATH

Created on July 10, 2025

linux

When you echo $PATH, the output is not read-friendly. Here is a simple way to spread each path on a new line instead of using colons.

This has been in my config for a long time. I wondered today how I implemented it, here it is:

# either:
echo $PATH | tr ':' '\n' | sort

# or:
echo $PATH | sed 's/:/\n/g' | fzf

# put it in your .zshrc:
which pretty_path
pretty_path () {
        echo $PATH | tr ':' '\n' | sort
}