Find the answer to your Linux question:
Results 1 to 2 of 2
I'm battling find right now. I want to find any file that matches a path governed by the following regular expression: "(monthly|nightly).[0-9]+/home/(user1|user2)/.mailbox/" to match files like: monthly.1/home/user1/.mailbox/mail.txt nightly.15/home/user2/.mailbox/cur/mail.txt I've tried: ...
  1. #1
    Just Joined!
    Join Date
    Feb 2010
    Posts
    7

    find with regex

    I'm battling find right now.

    I want to find any file that matches a path governed by the following regular expression: "(monthly|nightly).[0-9]+/home/(user1|user2)/.mailbox/"
    to match files like:
    monthly.1/home/user1/.mailbox/mail.txt
    nightly.15/home/user2/.mailbox/cur/mail.txt

    I've tried:
    regex1="(monthly|nightly).[0-9]+/home/(user1|user2)/.mailbox/"
    find ./ -regextype posix-egrep -regex $regex1
    and it just spins and never gives me an answer, even though the file structure isn't that big.

    what am I missing?

  2. #2
    Just Joined!
    Join Date
    Feb 2010
    Posts
    7
    anyone have any ideas?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...