Find the answer to your Linux question:
Results 1 to 4 of 4
Trying to make a simple alias for this find command: Code: find -regex '.*/\..*' -prune -o -type f -mtime -1 -print That command finds all files modified < 24 hours ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2011
    Posts
    12

    the 'find' command as an alias


    Trying to make a simple alias for this find command:
    Code:
    find -regex '.*/\..*' -prune -o -type f -mtime -1 -print
    That command finds all files modified < 24 hours ago. I use tcsh. If I do:

    Code:
    alias findNew   'find -regex '.*/\..*' -prune -o -type f -mtime -1 -print'
    I get:
    alias: No match.

    Lastly, If I want to replace the value '1' with an variable wildcard, do I use \!*

    Thanks.
    Mike

  2. #2
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,307
    Is the problem that you are nesting single quotes? Try this:

    Code:
    alias findNew 'find -regex ".*/\..*" -prune -o -type f -mtime -1 -print'

  3. #3
    Just Joined!
    Join Date
    Jun 2011
    Posts
    12
    Quote Originally Posted by atreyu View Post
    Is the problem that you are nesting single quotes? Try this:

    Code:
    alias findNew 'find -regex ".*/\..*" -prune -o -type f -mtime -1 -print'

    That was the problem. Thank you atreyu!

  4. #4
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,307
    np, and thanks for the find command. i like that one, will be storing it away...

Posting Permissions

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