AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.


#Power
 View Only
  • 1.  command(s) to match file date

    Posted Fri June 22, 2007 01:15 PM

    Originally posted by: SystemAdmin


    What command(s) to allow me to match the file date to a certain date that I specified, so that I can pick up a particluar file from the directory or the list? Make it simple, I want to find out whether the latest file was modified today (this morning)
    #AIX-Forum


  • 2.  Re: command(s) to match file date

    Posted Fri June 22, 2007 02:26 PM

    Originally posted by: dukessd


    ls -l | grep -i "mmm dd"
    where mmm is the first three letters of the month and dd is the date, 01 - 31.

    ls -l is a detailed list of the directory.
    grep searches and displays the output with matching character strings.
    -i tells grep not to be case sensitive (the month has an upper case first letter and the second and third are lower case).
    " " specifies grep should search for a character string that matches the info between the quotes, including spaces.

    so:
    ls -l | grep -i "aug 01"
    will display any files or directories in the current directory that were modified on the first of August.


    #AIX-Forum