|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi i know how to get no of files in some particular folder by following command which includes today and previous days files also Code:
ls |wc -l but i needed a command in which i can list previous one or two days files only. Last edited by radoulov; 07-06-2012 at 08:58 AM.. |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
I dont think you have much choice... you will have to use the
find command...
|
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
how can find be helpful in this case?
|
|
#4
|
||||
|
||||
|
If you only want to use ls, then you are to use
ls -l anda pipe with grep the pattern being the date.. (and a extra pipe for
wc -l
|
| Sponsored Links | |
|
|
#5
|
||||
|
||||
|
Code:
ran:/home/vbe $ ls -l|grep " Jun 1[12] " -rw-rw-rw- 1 vbe bin 4192 Jun 11 18:12 net_pb.out -rw------- 1 vbe bin 372 Jun 12 20:09 nohup.out ran:/home/vbe $ ls -l|grep " Jun 1[12] "|wc -l 3 Possible issue with this approach you will not have with find: Code:
ran:/home/vbe $ ls -l|grep " Jun 1[12] " -rw-rw-rw- 1 vbe bin 367 Jun 12 2009 dsk_todo.090526 -rw-rw-rw- 1 vbe bin 4192 Jun 11 18:12 net_pb.out -rw------- 1 vbe bin 372 Jun 12 20:09 nohup.out |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need Help in reading N days files from a Directory & combining the files | dsfreddie | UNIX for Dummies Questions & Answers | 1 | 12-30-2011 11:33 AM |
| Append Previous Days date to filename | Twisha | UNIX for Dummies Questions & Answers | 2 | 09-02-2010 12:20 AM |
| Number of days in the previous month | lyoncc | Shell Programming and Scripting | 11 | 08-10-2010 01:52 PM |
| using 'date' to get previous days' dates | slant-40 | UNIX for Dummies Questions & Answers | 2 | 06-17-2008 08:49 PM |
| ls latest 4 days or specify days of files in the directory | happyv | Shell Programming and Scripting | 3 | 01-22-2007 06:16 AM |
|
|