A
A
Alexey2017-07-25 14:01:47
linux
Alexey, 2017-07-25 14:01:47

How to execute a command recursively bypassing each subfolder?

For example, in the current case, I need to bypass all files in all folders and output those that have a certain encoding:
file -i *.* | grep "charset=iso-8859-1" >> my.file

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lynn "Coffee Man", 2017-07-25
@rixaman

Use find

find -type f -execdir sh -c "file -i {} | grep -qs charset=iso-8859-1" \; -print

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question