LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   General (http://www.linuxquestions.org/questions/general-10/)
-   -   Find all files, in a given tree, that are ascii text files? (http://www.linuxquestions.org/questions/general-10/find-all-files-in-a-given-tree-that-are-ascii-text-files-4175477662/)

stf92 09-18-2013 06:00 PM

Find all files, in a given tree, that are ascii text files?
 
Hi: a one-liner to recursively find all files, under the working directory, that are ascii text files?

rknichols 09-18-2013 06:11 PM

For a starter:
Code:

find . -type f -exec file {} + | grep ASCII
It has a few faults -
  • A file with the string "ASCII" anywhere in its path will be listed regardless of its content,
  • Paths containing a colon will be hard to parse from the output,
  • Ditto for path components with embedded newline characters.
How bulletproof do you need it to be?

stf92 09-18-2013 06:15 PM

I seem to have lost a text file documenting what the last working version of a program is. I can examine the 'file' command's output visually. They are not more than five or six.


All times are GMT -5. The time now is 10:52 AM.