Reply to Re: Select random files out of a directory
Posted by Martin Mandl - m2m tech support on 01/05/07 07:26
If you have access to system commands you could try the following:
1) Get the number of files using something like: ls | wc
2) Use your random generator
3) Now pick your line e.g. for file # 123: ls | head -123 | tail -1
Have fun
howa wrote:
> for example, there are 10K files in the directory,
>
> given that i don't know if files name, is it possible to fetch a file
> randomly?
>
> thanks.