Find command help - Unix

This is a discussion on Find command help - Unix ; Hi, Please let me know how to search for all file -newer than (let call this_file) . I interested only current directory "." NOT recursive to sub- directory . I used find command, but it not worked, which search to ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Find command help

  1. Find command help

    Hi,

    Please let me know how to search for all file -newer than (let call
    this_file) .
    I interested only current directory "." NOT recursive to sub-
    directory .

    I used find command, but it not worked, which search to all sub-
    directories.
    Bad: find . -newer this_file -print .

    Thanks
    M.


  2. Re: Find command help

    Minh wrote:
    > Please let me know how to search for all file -newer than (let call
    > this_file) .
    > I interested only current directory "." NOT recursive to sub-
    > directory .


    > I used find command, but it not worked, which search to all sub-
    > directories.
    > Bad: find . -newer this_file -print .


    Not bad, you're just missing '-maxdepth 1' to restrict the search
    to the current directory.
    Regards, Jens
    --
    \ Jens Thoms Toerring ___ jt@toerring.de
    \__________________________ http://toerring.de

  3. Re: Find command help

    * Jens Thoms Toerring [2007.03.15 09:53]:
    > Minh wrote:
    >> Please let me know how to search for all file -newer than (let call
    >> this_file) .
    >> I interested only current directory "." NOT recursive to sub-
    >> directory .

    >
    >> I used find command, but it not worked, which search to all sub-
    >> directories.
    >> Bad: find . -newer this_file -print .

    >
    > Not bad, you're just missing '-maxdepth 1' to restrict the search
    > to the current directory.


    In case the OP doesn't have GNU find (maxdepth is
    non-standard):

    find . ! -name . -prune -newer this_file -print

    --
    JR

  4. Re: Find command help

    2007-03-15, 08:16(-05), Jean-Rene David:
    > * Jens Thoms Toerring [2007.03.15 09:53]:
    >> Minh wrote:
    >>> Please let me know how to search for all file -newer than (let call
    >>> this_file) .
    >>> I interested only current directory "." NOT recursive to sub-
    >>> directory .

    >>
    >>> I used find command, but it not worked, which search to all sub-
    >>> directories.
    >>> Bad: find . -newer this_file -print .

    >>
    >> Not bad, you're just missing '-maxdepth 1' to restrict the search
    >> to the current directory.

    >
    > In case the OP doesn't have GNU find (maxdepth is
    > non-standard):
    >
    > find . ! -name . -prune -newer this_file -print


    Stricty speaking

    gfind . -maxdepth 1

    is

    find . \( -name . -o -prune \) ...

    that is "." is included. But sure enough, the OP is not
    interested in ".", so

    find . ! -name . -prune ...
    aka
    gfind . -mindepth 1 -maxdepth 1 ...

    is better.

    --
    Stéphane

+ Reply to Thread