The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




Thread: using find
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #6 (permalink)  
Old 09-30-2006
mph mph is offline
Registered User
  
 

Join Date: Mar 2006
Posts: 58
You could do this if you don't want to create a file:
Code:
fname=`find . -type f -exec file {} \; | grep 'ASCII' | awk -F\: '{print $1}'`
echo "$fname" | while read line
do
 ls -l "$line"
done
Use the -F\: with awk, and double quotes on vars to catch file names with spaces etc... Not recommended if you have a LARGE number of files to sort through, but work well for most apps.