Stop find command after the first file ...
Hi guys..
I am working on a Linux script ...but i face a problem regarding the find command because i want this command to stop after finding the first file for example Code:
find *.mp3 any help? |
what does
Code:
locate *.mp3 --limit=1 This should stop after the first file is located HTH Dave |
Quote:
? |
Try an obscure parmeter to find :
Code:
find *.mp3 -print -quit Code:
myfiles=$(find *.mp3 -print -quit) |
Thank you I LIKE Liverpool.
and also BIG THANK to AsusDave. |
You could pipe the output through head -1. When the pipe is broken by head, the find command will be killed.
This would allow you to for example limit the output to 10 files. |
All times are GMT -5. The time now is 12:41 AM. |