If a program isn’t working properly, you could be running a different version of it.

When programs don’t work the way they’re supposed to, one thing to investigate is that you’re running the correct version of the program.

For example, when I run ls to list files, I’m used to seeing the files ordered in multiple columns. So I was surprised one day when I saw that all my files were being listed in a single column, but none of the filenames were long enough to require a single-column listing:

% ls
Mail
discards
discards.backup
finger.mail
mysteries
notes.lmui
schedule

What was happening was that I recently changed my search path so /usr/5bin appeared before /usr/bin. Using the which command , I learned that the version of ls I was running was /usr/5bin/ls.

% which ls
/usr/5bin/ls

What I’m used to is /usr/bin/ls.

% /usr/bin/ls
Mail        discards.backup  mysteries       schedule
discards    finger.mail      notes

Get WYNTK: UNIX System Admininistrator now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.