Re: find與egrep的正規表示法的應用

看板Linux作者時間16年前 (2009/10/16 11:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
On Oct 5, 4:25 pm, Maxsolar....@OfO.twbbs.org (Astro v.s. Geo) wrote: > (snip) First of all, I've never used this switch -regex but I'm interested. And the man-page says: "This is a match on the whole path, ..." So, the leading "./" is relevant to the match and you should not have used "^[0-9]..." mkdir /tmp/x cd /tmp/x mkdir 2000/ 19991102_010129/ 19991025_091203/ 19990824_090817/ chen@cpq2200:/tmp/x$ find . -regextype posix-egrep -type d -regex "^.* [0-9]{7,}[_][0-9]{5,}$" ../19990824_090817 ../19991025_091203 ../19991102_010129 chen@cpq2200:/tmp/x$ PS1. The switch "-regextype posix-egrep " should be put before "-type d". PS2. Many people are referring to some "find -E" but I do not have one. PS3. I am running Debian/etch/2.6.27.35 regards rudi
文章代碼(AID): #1Ar-aobQ (Linux)
文章代碼(AID): #1Ar-aobQ (Linux)