|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Find with regex
hi,
how to use find with regexp? For example to remove all files that conatain t1, t2, t3 words I would write find -type f -regex /t[123]/ -exec rm {} \; but it does not work thanks oliver |
|
#2
|
|||
|
|||
|
I'm not sure where you are trying to do this. It looks like you are attempting to use the *nix find command, which means this post is in the wrong place. But never the less here you are:
Code:
find -name "t[1-3]" | xargs rm That should do your job. If you are doing as I think you are xargs will be more efficient than rm {} You also don't need to specify -regex, you just need to specify the identifier flag, such as -name. HTH
__________________
Did this post help? Please Click The Next To My PostNeed help? Did you try Google? Take a look over at my current work in progress http://crispycrisp.org |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Other Programming Languages > Find with regex |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|