Apple Terminal
Read-onlyShow Your PATH One Entry Per Line
A tool runs from an unexpected location because PATH order is unclear.
Command
echo "$PATH" | tr ':' '\n' | nl -ba
Before you run this
System impact: Read-only. Low when scoped to the shown target.
When not to use it: Do not use it as proof that a command exists. Pair it with command -v for that.
Expected output
A numbered list of PATH directories in search order.
System impact
Read-only. Nothing changes. The command formats PATH for easier reading.
Recovery / rollback: no state is changed.
When to use it
Use when Homebrew, npm, pyenv, rbenv, or Xcode command line tools seem to resolve the wrong executable.
When not to use it
Do not use it as proof that a command exists. Pair it with command -v for that.
Watch this command run
Command transcript
This sanitized transcript shows the commands and output shape without exposing host details.
$ PATH_FIXTURE='/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin'; echo "$PATH_FIXTURE"
/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin
$ PATH_FIXTURE='/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin'; echo "$PATH_FIXTURE" | tr ':' '\n' | nl -ba
1 /opt/homebrew/bin
2 /usr/local/bin
3 /usr/bin
4 /bin
View commands shown
These are the commands shown in the sanitized transcript.
Commands shown
PATH_FIXTURE='/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin'; echo "$PATH_FIXTURE"PATH_FIXTURE='/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin'; echo "$PATH_FIXTURE" | tr ':' '\n' | nl -ba
next steps
Related commands
See Exactly Which Command macOS Will Run
Before blaming npm, Python, or Git, check the binary your shell actually found.
command -v node && node -v
Find Large Files Inside a Project
Before committing, check whether a huge video, build artifact, or export slipped into your repo.
find . -type f -size +100M -print
Find What Is Using a Local Dev Port
Your dev server says port 3000 is busy. Ask macOS who is holding it.
lsof -nP -iTCP:3000 -sTCP:LISTEN
Find Which Folder Is Eating Disk Space
When your Mac is full, start with the biggest folders in the current directory.
du -sh ./* 2>/dev/null | sort -h
Check a URL Without Downloading the Page
Before opening a broken page in five browsers, ask the server for headers.
curl -I https://example.com
Study mapping
Use this as independent command practice: read the notes, predict the output, then compare it with the example before using a real shell.
Useful for
- LPIC-1 style command-line practice
- LFCS style performance tasks
- Linux+ style troubleshooting review
Independent study support only. No affiliation, endorsement, exam dumps, or real exam questions.