![]() |
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 list files Created in last 2 hrs | rsonakiya | UNIX for Dummies Questions & Answers | 4 | 03-02-2009 07:25 AM |
| Files created in last 24 hours | jayaramanit | Shell Programming and Scripting | 1 | 09-08-2007 04:34 AM |
| command to list files that are created before some date | csreenivas | SUN Solaris | 3 | 06-27-2007 06:34 PM |
| I want to get the file which created the error when the find command was run | guhas | Shell Programming and Scripting | 1 | 10-21-2005 03:06 PM |
| command unix to list all files created since n month ago | yacsil | Shell Programming and Scripting | 8 | 12-15-2003 01:12 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Using ls
Don't think you can using ls
Look at using find with the -ctime switch It would be something like find <dir> -ctime n -exec ls -l {} \; the n refers to files whoses status has changed n x 24 hours ago |
|
||||
|
Quote:
With Regards Dileep Pattayath |
|
||||
|
Yeah Sure...
find . -type d ! -name '.' -prune -o -type f -mtime +1 -print As you know, find command will start from the directory u have mentioned and will descend into the subdirectories.. What I assumed from the question was.. i should display all the files in the current directory that are created before a day... the first attribute list -type d ! -name '.' -prune if the type is a direcorty ('d' ) and if it is not current ('.') then do not descend into it... -o or option -mtime +1 modification time more than a day or more than 24 hours.. you can also use -ctime if u wanna keep track of inode changes as well... -print - will print the file name |
![]() |
| Bookmarks |
| Tags |
| mtime |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|