Hacker News new | ask | show | jobs
by lovelymono 1178 days ago
They could have used

  ls -A -1 -p
which should result in the same output.

-A is like -a but will not print . and .. directories.

-1 prints one file per line.

-p appends / to directories.

There's a lot more flags in the man page: https://man7.org/linux/man-pages/man1/ls.1.html

1 comments

That's GNU ls; AFAICT -1 and -p aren't POSIX so might not work on other unix-likes (most prominently Darwin, but also the BSDs)
https://pubs.opengroup.org/onlinepubs/009696899/utilities/ls... lists both -p and -1. And while -p is marked as an XSI extension, both Darwin and all modern BSD distributions implement it.
Huh, good catch. Not sure why `man 1p ls` didn't give me that:\