The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > Linux
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 05-07-2008
robotronic's Avatar
robotronic robotronic is offline
Can I play with madness?
 

Join Date: Apr 2002
Location: Italy
Posts: 370
Sure Try with awk:

Code:
find $defPath/archive/sub/subchild -type f -mtime +365 -exec ls -l {} \; | \
awk '{ for (i=5;i<=NF;i++) printf("%s%s", $i, i==NF?"\n":" ") }'
This implies that the fields you require are:

$5 = Size
$6, $7, $8 = Date (the output may depend on the international settings)
All the remaining = File name
Reply With Quote