![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to find a file named vijay in a directory using find command | amirthraj_12 | UNIX for Dummies Questions & Answers | 6 | 10-25-2008 12:37 PM |
| how to find difference of 2 timestamps in secs? | Alecs | UNIX for Dummies Questions & Answers | 0 | 03-24-2008 12:36 PM |
| mv command and file-timestamps | gian1975 | UNIX for Advanced & Expert Users | 1 | 07-04-2006 10:01 AM |
| find command not giving file names accord. to timestamps | thanuman | UNIX for Dummies Questions & Answers | 8 | 09-07-2004 09:04 AM |
| command find returned bash: /usr/bin/find: Argument list too long | yacsil | Shell Programming and Scripting | 1 | 12-15-2003 06:38 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Find command to get the timestamps
I want to have the timestamps of the files containing a specific string in them.
I have tried using different combinations of find command and grep and ls but not giving the desired output. find $HOME/bin/shells -name "*" -print -exec ls -Flt {} -exec grep -i "abc" '{}' \; Please help. |
|
||||
|
Thanks for the reply.
I am using the same command and it is funny that even though I use ls -Fl, the list is not in that order. I am trying to get the list with latest file top in the list. ls -Fl should do that. But I don't understand why it is not doing. Below is my command. find $dir -name "*" -exec grep -q "abc" {} \; -exec ls -Flt {} \; | awk '{print $8}' | read timestamp. I am expecting to have timestamp = Latest file time stamp. Please suggest. Thank you. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|