Results 1 to 4 of 4

Thread: find command

  1. #1
    Join Date
    Oct 2005
    Posts
    92

    Unanswered: find command

    Hi all.,

    i am using the follwowing command..
    ls -ltr TNT.*.*.*.ctl* | awk -F" " '{print $6" "$7 }'

    the output is:
    Feb 27
    Feb 27
    Feb 27
    Feb 27
    Feb 28
    Feb 28
    Mar 9
    Mar 21
    Mar 21

    from this output i am trying to get the FIND the files on march 21. i am using the find command no results.

    can anyone please give me some suggestions

    thanks
    pavi

  2. #2
    Join Date
    Oct 2005
    Posts
    92

    find command

    HI all.,

    this is what i am trying to accomplish exactly;


    i have a dir and inside that i have certain files. files keep arriving in that dir. the dir has lot of files but i have to process only those files that arrive today.

    for eg: today is mar 21 so i have to process only those files that arrived today.

    each dir comes with a prefix TNT and suffix as ctl*
    so i tried to use this command;
    ls -ltr TNT.*.*.*.ctl* | awk -F" " '{print $6" "$7 }'
    the output is:
    Feb 27
    Feb 27
    Feb 27
    Feb 27
    Feb 28
    Feb 28
    Mar 9
    Mar 21
    Mar 21

    now i know that today ( Mar 21) there are 2 files that arrived. so i have to pick up ( or find ) these 2 files that arrived today and process them.

    thanks
    pavi

  3. #3
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Cool


    If you need the files arrived within the last 24 hours use:
    Code:
    find . -name TNT.*.*.*.ctl* -mtime -1

    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

  4. #4
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    To find all files created on or after 21 March 2006 00:00:00
    touch -t 200603202359.59 /tmp/reffile
    find . -name TNT.*.*.*.ctl* -newer /tmp/reffile

Posting Permissions

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