Wednesday 1 April 2009

Looping through a file search in unix

Little handy script in unix to get file details from a find result
#!/bin/sh

# Find all the log files and loop through them
for file in `find $HOME -type f -name \*.log`; do
  # Get the file details
  ls -al $file
done