ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Try using "-regex" instead of "-name". Also, "*" itself doesn't do anything; it means "previous character repeated 0 or more times". That means you should have a "." (any character) before the first "*":
Code:
.*tau[1-6][!0-9]*_IDs.dat
So is this what you intend?
Code:
(anything consisting of 0 or more chars)("tau")(single char 1 through 6)(0 or more of "!" or 0 through 9)("_IDs.dat")
ta0kira
edit: If you mean "[!0-9]*" as "any group of something besides numbers" you need to change "!" to "^".
i was so unprecise with definition what I would like to do. sorry.
I have this kind of files in the different sub directories:
file_tau1_IDs.dat
file_tau3_specIDs.dat
file_tau5_IDs.dat
file_tau6_specIDs.dat
file_tau10_IDs.dat
file_tau2_specIDs.dat
so on ...
Numers running from 1 to 10. I would like to manipulate only files that contain
numbers 1 to 6 (ie no 7, 8, 9, 10) and only that with _IDs.dat (ie. no *_specIDs.dat).
Especially I have a problem to exclude file that has 10.
find -regex '.*file_tau[1-6]_IDs.dat' | xargs someCmd
or just shell globbing would do for what you've just described:
someCmd file_tau[1-6]_IDs.dat
-- Oops. Need to read more carefully - shell globbing won't suffice if some are in subdirs. Though something like 'someCmd {,*/}file_tau[1-6]_IDs.dat' would work for one level of subdirs and so on.
Last edited by slakmagik; 06-16-2007 at 12:21 PM.
Reason: re-read more carefully
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.