[olug] Traversing directories with the file command

webtrekker at cox.net webtrekker at cox.net
Wed Jun 22 17:36:04 UTC 2005


HELP!!
I am trying to create a way to use 'file' and grep to identify perl, shell scripts, ELF apps, etc and list their last modified time.  I have been able to use the following command but it only works in the current directory.  'file' doesn't seem to be able to follow a directory tree or have a recursive flag.
Here is what I have so far:
  file * | grep perl | awk -F : '{print $1}' | xargs ls -lct

If there was a way to embed that into a script that went through a directory structure that should work.  I am not very good at script writing though so any help would be appreciated!
Thanks





More information about the OLUG mailing list