In the root directory of my USB flash drive, sometimes when I run
ls, the output is normal and it lists the files. At other times, the output is simply one line:
$ ls .
If I try
ls -la at one of those times, I get this:
$ ls -la ls: .: Invalid argument
If I run
ls back to back multiple times, it seems to return either the normal output or the abnormal one basically at random.
ls appears to work normally in other directories.
ls $drivename even appears to work fine from the parent directory, and
ls .. seems to work fine from a child directory. (Though I can't be 100% sure of the ones that "work normally" since the behavior is indeterminate to begin with.) I tried two other external USB drives and got the same behavior.
What's going on here? I'm on Mac OS X 10.11.3.
Edit: Nice idea, but I don't seem to be using an alias, and
/bin/ls gives the same result.