find command: trying to specify number of results to display
so im fiddling around with commands trying to learn scripts and i am trying to find the oldest file on the system.
I did 'find -iname / "*.*" -atime +300 -exec ls -lart -1 {} \; and it seems to work fine but prints out several files and I only want the top most one -- the largest. Is there a way to output only the first displayed result of this command or any other commands such as ls and stuff? |
cut and sed can both be used to select which lines to print/display. I think "head" also.
What texts are you using? You may want to go to http://tldp.org and get the Bash Guide for Beginners. |
head's what you want. man head for the syntax.
|
All times are GMT -5. The time now is 08:38 AM. |