I have a directory with both hidden (name starting with
) and non-hidden files as follows:
$ ls -a1
How can I get a listing of all of them in a single call?
to return all files, but it doesn't:
# => ["not-hidden"]
The best I can think of is:
Dir['*'] + Dir['.*']
# => ["not-hidden", ".", "..", ".hidden"]
And I also expected there to be a way to use a regex, but I cannot find one, and it's not possible to use
because there is no call capable of getting both hidden and non-hidden from which to select.