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 Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Can I know find syntax to find given date files bache_gowda Shell Programming and Scripting 3 03-26-2008 06:37 AM
How can I find files by date or size from stout? umen UNIX for Dummies Questions & Answers 2 01-13-2008 09:04 AM
find files by date kani Shell Programming and Scripting 1 10-25-2007 06:51 AM
how to find files less than the current date mallikarjuna UNIX for Dummies Questions & Answers 4 01-20-2006 01:49 PM
BASH : Find files by date and shred them cbismuth Shell Programming and Scripting 2 06-13-2005 11:20 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-11-2006
gkrishnag gkrishnag is offline
Registered User
  
 

Join Date: Jul 2006
Posts: 49
Find all the files after the date?

Hi

I am using
#!/bin/sh
DATE="$1"
FILE="$2"
FLIST=""
for f in $FILE
do
FDATE=$(ls -l $f | awk '{ print $6 }')
if [ "$DATE" == "$FDATE" ];then
FLIST="$FLIST $f"
fi
done

[ "$FLIST" != "" ] && echo $FLIST || echo "Sorry no files found to match $DATE date."

the below... need correction

whne i execute the above
date.sh "2006-01-01" "*.sh"

/home/cvs ->date.sh 2006-01-01 "*.sh"
date.sh[12]: ==: A test command parameter is not valid.
date.sh[12]: ==: A test command parameter is not valid.
date.sh[12]: ==: A test command parameter is not valid.
date.sh[12]: ==: A test command parameter is not valid.
date.sh[12]: ==: A test command parameter is not valid.
date.sh[12]: ==: A test command parameter is not valid.
Sorry no files found to match 2006-01-01 date.
  #2 (permalink)  
Old 09-11-2006
tayyabq8's Avatar
tayyabq8 tayyabq8 is offline Forum Advisor  
Moderator
  
 

Join Date: Nov 2004
Location: Bahrain
Posts: 578
Quote:
Find all the files after the date?
Are you only looking for this, since your requirment is not clear, I assume that you need to search files newer than specified date, suppose you want to search for files newer than 01-Sep-2006, you could try something like this:
Code:
#Create an empty file based on date you are looking for, following format is: YYYYMMDDhhmm
touch -t 200609010001 testfile
find . -newer testfile -print
Find command will look for files newer than testfile(01-Sep-2006) and print their path.

For more explanation, search these forums with keyword touch, you'll find many posts answering your question.

Regards,
Tayyab
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 03:57 AM.


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