3

I'm trying to recursively open all the files in a folder, including its directories. I've been playing around with open /path/to/folder/*, and this will open all the files inside that folder but not include the sub-directories.

If I had a folder tree that looked like this:

Folder
>subfolder1
>>file1.jpg
>>file2.jpg
>subfolder2
>>file1.jpg
>>file2.jpg
>subfolder3
>>file.jpg

How could I open all the files in one terminal command?

6

I would suggest

find . | xargs open
  • 1
    Note that this has the potential to massively slow down / crash your system if you run it in the wrong folder... =P It won't ask if you really want to open every single file on your computer. – daviewales May 20 '13 at 6:11
  • As a side note, you can also use "find ./*/*.jpg | xargs open" if there are non jpg files that you want to ignore. – Jason McTaggart May 9 '14 at 12:38
  • I would rather use find . -name "*.jpg" – Matthieu Riegler May 9 '14 at 16:49

You must log in to answer this question.

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