help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] The best way to get a file in a directory


From: Chris F.A. Johnson
Subject: Re: [Help-bash] The best way to get a file in a directory
Date: Thu, 29 Nov 2018 13:32:14 -0500 (EST)
User-agent: Alpine 2.10 (DEB 1266 2009-07-14)

On Thu, 22 Nov 2018, Peng Yu wrote:

Hi,

I'd like to get a file in a directory. It can be any file in the
directory. I don't care what it is as long as it is in the directory.

I don't want to use * to get all the files and then pick one from them
as this can be slow when there are many files in a directory. Is there
an efficient way in bash to get a file in a directory? Thanks.

Perhaps bash should have an option to not sort filename expansion: 'shopt -s 
nosortglob'?

--
Chris F.A. Johnson, <http://cfajohnson.com>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]