Use find
and xargs
to pipe the file contents into tr
like so:
find some_folder -type f -print0 | xargs -0 cat|tr -cs "[:alpha:]" "\n"
Question
I can do this like for one file:
tr -cs "[:alpha:]" "\n" < some_file
But, how to processing tr
to all files in a folder recursive?
tr -cs "[:alpha:]" "\n" < /some_folder
or
tr -cs "[:alpha:]" "\n" < *
It gives me an error like:
tr: read error: Is a directory
La solution
Use find
and xargs
to pipe the file contents into tr
like so:
find some_folder -type f -print0 | xargs -0 cat|tr -cs "[:alpha:]" "\n"