Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • You might want to use + instead of \; in your first example (if your version of find supports is) so as not to fork too much on ls. Might also want to add \! -name '.*' so as not to list hidden files. Commented Jul 6, 2013 at 14:36
  • 1
    Oh, and if you want to parse the output of ls, and if your ls version supports the -p option, you can ls -lip | grep -v '/$' Commented Jul 6, 2013 at 14:49
  • @gniourf_gniourf since the + is not always available and we are only running ls which is not too hard on the machine I don't think it is worth it. As for hidden files, I consider listing them a feature not a bug :). Commented Jul 6, 2013 at 14:49
  • @student I rejected your edit because the -execdir option, while great, isn't portable and I don't want this answer to be specific to GNU find. Note that in my rejection message I incorrectly claimed the + is also not portable, but that is wrong. The + is in POSIX, but -execdir is not. Commented Mar 20 at 10:21