1

I really don't like how Linux ls -al mixes files and directories.

Is it possible to list directories, then files, with single command?

dirA
dirB
dirC
fileA
fileB
fileC
11

As usual, man ls is your friend. If you're running Linux with the GNU coreutils, the --group-directories-first does precisely what you ask for.

|improve this answer|||||
  • That easy?? I remember it was some pretty complicated script few years back, so I didn't even bother. Maybe I confused it with something else, sorry. Thanks. – Danijel Mar 14 '17 at 17:53
  • 1
    @Danijel well 10 years ago, the option didn't exist :) But it's been present for more than 5 years. – wazoox Mar 14 '17 at 18:05
  • Well... maybe it was 10 years ago. Time flies... :-) – Danijel Mar 14 '17 at 18:07

Not the answer you're looking for? Browse other questions tagged or ask your own question.