The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



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 !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
sort files by date itik Linux 1 06-02-2008 06:25 PM
sort files by date, delete oldest, if total size bigger than scarfake Shell Programming and Scripting 2 05-21-2008 08:02 AM
loop through the directory for files and sort by date and process the first file dsdev_123 AIX 1 01-30-2008 05:31 PM
Sort files by Date-timestamps available in filename & pick the sortedfiles one by one Chindhu Shell Programming and Scripting 4 08-10-2007 07:54 AM
capture all the today files Teh Tiack Ein Shell Programming and Scripting 3 07-28-2005 06:30 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-17-2008
carlosdivega carlosdivega is offline
Registered User
  
 

Join Date: Jul 2008
Posts: 2
Sort files by date, not showing files from today

Hi all,

i'm new here in this forum. I really like the helpful answers in this forum.

Here a short question.
For a script i have to sort files by date and exclude the files of the actual date.

Sorting the files by date and preparing the output for awk is done by this line:

ls -l Transfer*.log | awk '{ print $6 $7"08 " $9}' | sort -k 1,1 | awk '{print do my comand}' | csh

Is there a easy way to extend this one liner to exclude files of the actual day.

Many thanks for all you input.
Carlos Di Vega
  #2 (permalink)  
Old 07-17-2008
zaxxon's Avatar
zaxxon zaxxon is offline Forum Staff  
Moderator
  
 

Join Date: Sep 2007
Location: Germany
Posts: 2,285
Maybe just do
Code:
find . -type f -name "Transfer*.log" -mtime +1 -print
Not sure if you want it being recursive, else just -prune it.
  #3 (permalink)  
Old 07-17-2008
carlosdivega carlosdivega is offline
Registered User
  
 

Join Date: Jul 2008
Posts: 2
Hi zaxxon!

Many thanks for your fast reply. Your solution will do the trick.

Carlos Di Vega
  #4 (permalink)  
Old 07-17-2008
TinWalrus TinWalrus is offline
Registered User
  
 

Join Date: May 2007
Posts: 35
ls -lt | grep -v "$(date '+%b %d')"

depending on the way ls -l date is displayed, may need to manipulate the date format ..

you can sort reverse by
ls -ltr | grep -v "$(date '+%b %d')"
Closed Thread

Bookmarks

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:22 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0