2

MacOS puts “.DS_Store” files in directories. How do you omit them from all “ls -a” results?

1
  • pipe it with `grep -v ".DS_Store"' ?
    – Antoine
    Sep 17 '20 at 15:29
3

ls -a specifically tells ls to list all files/directories and especially those starting with ., there is no direct way to suppress them. Of course there is always

ls -a | fgrep -v .DS_Store 

but this may be rather cumbersome.

1
  • 4
    ls -a | fgrep -v .DS_Store | column to recreate the default output
    – lhf
    Sep 17 '20 at 15:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .