UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old September 24th, 2004, 10:43 AM
htownclown htownclown is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 2 htownclown User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
ls -?????

Looking for a way to list (ls) based on mod/create date. The closest I’ve come is something like (ls –ltr). This of course returns all files in a given directory. If anyone is familiar with VMS it would be equivalent to (dir/sin). I’m trying to incorporate this into a ftp script that deals with exact reoccurring file names.

Reply With Quote
  #2  
Old September 24th, 2004, 03:37 PM
jim mcnamara jim mcnamara is offline
......@.........
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jun 2004
Posts: 1,307 jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 4 h 28 m 57 sec
Reputation Power: 48
You want find

Suppose you want everything from Sep 1 on ... use touch
Code:
touch -t 200409010001  t.file
find /path./to/file -newer t.file

This finds files with a mod date newer than t.file

And -

NB there is no create date in Unix only:

1. last access
2. last modify
3. last inode change (permissions change, ownership change etc on file)

Reply With Quote
  #3  
Old September 24th, 2004, 11:41 PM
htownclown htownclown is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 2 htownclown User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally Posted by jim mcnamara
You want find

Suppose you want everything from Sep 1 on ... use touch
Code:
touch -t 200409010001  t.file
find /path./to/file -newer t.file

This finds files with a mod date newer than t.file

And -

NB there is no create date in Unix only:

1. last access
2. last modify
3. last inode change (permissions change, ownership change etc on file)


That actually works great however the question is a little deeper and involves more FTP logic. I've actually created a script containing your suggestions and aliased it to a new command within my environment. It works great. I'm going to try and include my code for future forum reference. Feel free to pick it apart.
Attached Files
File Type: txt lsin.txt (222 Bytes, 240 views)

Reply With Quote
  #4  
Old September 27th, 2004, 11:31 AM
jim mcnamara jim mcnamara is offline
......@.........
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jun 2004
Posts: 1,307 jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 4 h 28 m 57 sec
Reputation Power: 48
That script does a (in VMS like terms) DIR/SINCE=START_OF_THIS_MONTH.
You may want something more flexible:

try www.unix.com - there are some "FAQ" tutorials one on the find command. one on date arithmetic:

http://www.unix.com/showthread.php?s=&threadid=13863
http://www.unix.com/showthread.php?s=&threadid=13785

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > ls -?????


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway