Re: Shell expansion of * and hidden files

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

 



On Thu, 22 Jul 2004, Alan Horn wrote:


On Thu, 22 Jul 2004, Ulrich Drepper wrote:

The most straight-forward way is to tell the shell you want the dot files:

$ ls -a
./  ../  .uu
$ echo *
*
$ shopt -s dotglob
$ echo *
.uu
$ shopt -u dotglob
$ echo *
*


I find that

ls .??*

usually works well.

actually, it doesn't, since it wouldn't match the perfectly valid ".a". it's a popular puzzle to come up with a glob that matches all hidden thingies, without matching "." or "..". and the solution is ...


$ echo .[!.]*

why it works left as an exercise for the reader.

rday



[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux