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
  • To start with, this is why it's not a good idea to parse the output of find. Are all of the files in /var/www/foorumi/attachments/2020/04/? If so cd into it and then use printf '%s\n' * to return the filenames without the directory appended. Also, add the expected output to your question so that there is a better idea of what you are trying to do. Commented Apr 2, 2020 at 6:14
  • @Nasir Riley no need for printf, file reads multiple files directly: file -i0 *. btw, find, unlike ls can be used safely. Commented Apr 2, 2020 at 7:08
  • It isn't a good idea to parse the output find, either: unix.stackexchange.com/questions/321697/… Using find -exec is okay, but not for what HendriXXX is trying to do. Commented Apr 2, 2020 at 7:35
  • To be precise: parsing find done right is totally fine, but you may be talking (and linked) looping. Commented Apr 2, 2020 at 8:02