I am searching for a method to find only JPEG files/ With my limited knowledge of Linux I came to this point:
- list all paths that exist from root below with
find /
- pipe the result into next command and perform the
file
command on each found path withxargs file
- In the result of the
file
command is a JPEG string contained, I thought maybe it would be possible somehow to an IF-statement to filter only the JPEGs: If (JPEG contained in output of file command) {show argument of file}
once more:
find / | xargs file | "If statement"
Could you please correct me, give me a hint how to perform the task or give a solution?
.jpg
extension (or vice versa)? If not, search by name, as in sam's answer.