Re: unix question

The below command should delete all files older than 30 days:

find mydir '/home/faserv/lafonde' -type f -mtime +30 -exec rm -f '{}' \;



On 05.10.2010 19:32, Lafond, Eileen wrote:
I guess that the type of Unix that we have is as follows:

Sun Microsystems Inc.   SunOS 5.10      Generic January 2005

I consider myself a novice, but I write crontabs, cron jobs, sql and bat files. 
 My problem is with the actual unix itself as with all the slashes, brackets, 
etc.

I am starting off with a find command to see if I can find the correct files.  
Then I want to do the rm command.  I have attempted the man pages in the past 
to no avail.  I find them very confusing.  I do better with actual samples.

Right now I have a question on the find command that I put together somehow and 
it works if I don't have the 'type f' filled in.  I thought that that meant the 
type of file.  I am looking for all the *.lst files, but I get error messages 
on this.  Otherwise this seems to work to find the files for me.

find mydir '/home/faserv/lafonde' -type f 'lst' -mtime +30 -exec ls -ld {} \;

Any suggestions?

Thanks,

Eileen La fond
Work phone: (206) 386-0011
email: eileen.lafond@xxxxxxxxxxx



-----Original Message-----
From: programmingblind-bounce@xxxxxxxxxxxxx 
[mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Alex Midence
Sent: Tuesday, October 05, 2010 10:08 AM
To: programmingblind@xxxxxxxxxxxxx
Subject: Re: unix question

Be careful with this kind of stuff because your unix variant may make
you do things slightly differently.  Waht kind of unix is it?  Is it
Aix, hpux, solaris, ...?  You are sure it is Unix and not Linux?
Sometimes, people say unix when they mean linux.  The are not the same
thing.  They share similarities though and hence the confusion.  I
used to be guilty of this myself.  Jim Bauer's instructions look right
to me but I'd double check your system before you implement them.

Alex M

On 10/5/10, DaShiell, Jude T.  CIV NAVAIR 1490, 1, 26
<jude.dashiell@xxxxxxxx>  wrote:
No, but I can tell you to do the command info find<enter>  or man find
<enter>  and start taking notes.  You may get a few good ideas.

-----Original Message-----
From: programmingblind-bounce@xxxxxxxxxxxxx
[mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Lafond,
Eileen
Sent: Monday, October 04, 2010 18:36
To: programmingblind@xxxxxxxxxxxxx
Subject: unix question

Hi,

I am a unix novice and I need to write some unix to delete all the files
in a directory that are older than 30 days.  Can someone help me compose
this?

Thanks,

Eileen La Fond
Phone: (206) 386-0011
email: eileen.lafond@xxxxxxxxxxx
__________
View the list's information and change your settings at
http://www.freelists.org/list/programmingblind

__________
View the list's information and change your settings at
http://www.freelists.org/list/programmingblind


__________
View the list's information and change your settings at
http://www.freelists.org/list/programmingblind

__________
View the list's information and change your settings at
http://www.freelists.org/list/programmingblind

__________
View the list's information and change your settings at http://www.freelists.org/list/programmingblind

Other related posts: