Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Loop through directory with:*.file* filename

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi There!

How can I loop through the whole directory and look at/manipulate file with "*.file" filenames one by one?

-CGrace7
 
Try:
Code:
find . \( -type d ! -name -prune \) -o \( -type f -name "*.file" -print \) |
while read file
do
  echo "looking at $file"
done
Cheers, Neil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top