MaryCoding
MaryCoding

Reputation: 664

Append find result to txt file

I am trying to concat jpg and png images with the use of ffmpeg. Before doing so, I am trying to append the file name and paths to a txt file. However, I am getting an error. The files have to follow the format file '/media/test.jpg' for appending to the txt file. What would be the best way to achieve this?

Print files:

find . \( -name '*.jpg' -o -name '*.png' \) -print 

Error when trying this:

find . \( -name '*.jpg' -o -name '*.png' \) printf "file '%s'\n"  > mylist.txt

Upvotes: 1

Views: 110

Answers (1)

Petr Skocik
Petr Skocik

Reputation: 60068

find . \( -name '*.jpg' -o -name '*.png' \) -printf "file '%p'\n" >> mylist.txt 

Upvotes: 2

Related Questions