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
how to find a file named vijay in a directory using find command amirthraj_12 UNIX for Dummies Questions & Answers 6 10-25-2008 12:37 PM
Help Required: Command to find IP address and command executed of a user loggedout Security 2 08-06-2008 08:12 PM
Little bit weired : Find files in UNIX w/o using find or where command jatin.jain Shell Programming and Scripting 10 09-19-2007 06:47 AM
command find returned bash: /usr/bin/find: Argument list too long yacsil Shell Programming and Scripting 1 12-15-2003 06:38 PM
how to find a file in UNIX without find command? bluo Shell Programming and Scripting 3 09-24-2003 11:47 PM

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 01-31-2008
Phuti Phuti is offline
Registered User
  
 

Join Date: Jan 2008
Location: I live in Pretoria, South Africa
Posts: 9
Find Command

Hi Guys

I want to write a script or a command tha will give me certain files and exclude others. For example I have log files that I want to move to another directory but I don't want to move the logs that were generated today...I am using HP-UX...

Please Help

Thanks
  #2 (permalink)  
Old 01-31-2008
Yogesh Sawant's Avatar
Yogesh Sawant Yogesh Sawant is offline Forum Staff  
Part Time Moderator and Full Time Dad
  
 

Join Date: Sep 2006
Location: Rossem, Tazenda
Posts: 1,086
does your system have find command? if yes, does it have -mtime -type -name options?
  #3 (permalink)  
Old 01-31-2008
Phuti Phuti is offline
Registered User
  
 

Join Date: Jan 2008
Location: I live in Pretoria, South Africa
Posts: 9
Yes it does have those functions...
  #4 (permalink)  
Old 01-31-2008
arunkumar_mca arunkumar_mca is offline
Registered User
  
 

Join Date: Oct 2004
Posts: 255
this is a small example

which will remove the file xxx* which has not accessed 14 days before


find your directory -name "xxx*" -mtime +14 -exec rm "{}" ";"


Cheers,
Arun
  #5 (permalink)  
Old 02-01-2008
ynilesh's Avatar
ynilesh ynilesh is offline
Registered User
  
 

Join Date: Oct 2007
Location: Bangalore, India.
Posts: 222
find . -mtime +2 -print
Period (.) is for current directory. This will print all logs more than 2 days old.

if you want to move those files to some other directory use mv command with -exec.

Hope this will help you.
Sponsored Links
Closed Thread

Bookmarks

Tags
find -mtime

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 10:51 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