4

I was just trying to list files in the current directory with a certain pattern, but it doesn't work with hidden files. How can I match all the files?

I tried

ls *foo*

and

ls -a *foo*

Not finding anything in Google, the keywords I can think of to search for this lead to a lot of unrelated informations...

ixx
  • 295
  • 2
  • 11

1 Answers1

8

Enable globbing for hidden files:

shopt -s dotglob
ls *foo*

Disable:

shopt -u dotglob

Show globbing status:

shopt dotglob
Cyrus
  • 5,751