Re: find with regex to find files matching pattern

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

 



ls /cloud_nfs/*PID.dat

/cloud_nfs/1.2.3.4_PID.dat
/cloud_nfs/100.2.3.4_PID.dat


find . -regex  '*\./*(\d+.\d+)*'   ----not working.. ive seen multiple
examples.. so i'm doing something wrong...

i've cd'd to the dir in question to run the test find...

I know this is "simple" so i''m missing something...

thanks


On Sun, Dec 25, 2016 at 9:44 PM, Jon LaBadie <jonfu@xxxxxxxxxx> wrote:
> On Sun, Dec 25, 2016 at 09:09:38PM -0500, bruce wrote:
>> Ok..
>>
>> Maybe too much xmas glee...
>>
>> Sample files
>> 1.2.3.4_foo.dat
>>
>> 11.2.3.4_foo.dat
>>
>> 1.22.33.4_foo.dat
>>
>> etc.....
>>
>> the fillenames follow the ipAddress format..
>>
>> Trying to craft a simple find with regex/pattern to find the files.
>>
>> find / -name  "*[0-9]{3}*"  << doesn't work
>>
>
> First, none of the files you show match your expression, even if it
> was interpreted as a regular expression.  None have 3 consecutive digits.
>
> Second, man find(1).  -name != -regex.  And see also -regextype.
>
> --
> Jon H. LaBadie                  jonfu@xxxxxxxxxx
> _______________________________________________
> users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
> To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]
  Powered by Linux