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
Getting current work directory in Command Prompt MeganP UNIX for Dummies Questions & Answers 3 07-20-2007 01:49 PM
how to stop to current directory using find james_falco UNIX for Dummies Questions & Answers 1 07-17-2007 08:43 PM
how do i exclude the current directory when using find? mjays Shell Programming and Scripting 7 04-24-2007 08:13 AM
Question about Restricting Search path of FIND to current directory super_duper_guy UNIX for Dummies Questions & Answers 2 10-17-2005 09:10 AM
find directory not including current dangral UNIX for Dummies Questions & Answers 2 01-26-2005 03:02 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 02-22-2001
jliebling jliebling is offline
Registered User
  
 

Join Date: Feb 2001
Location: Burbank, CA
Posts: 3
Unhappy

I am trying to use the find command to find files in the current directory that meet a certain date criteria.

find . -type -f -mtime +2

However, the above also checks the directories below.
I tried -prune, but that seems to ignore this directory completely.

I read about using -path w/ -prune, but -path is not recognized by my system. Neither is -maxdepth.

Any help would be greatly appreciated!!!!

Thanks,
Julie
  #2 (permalink)  
Old 02-22-2001
Neo's Avatar
Neo Neo is offline Forum Staff  
Administrator
  
 

Join Date: Sep 2000
Location: Asia Pacific
Posts: 6,656
from the GNU find man page:

Quote:
find - search for files in a directory hierarchy

....... omitted much ........

-maxdepth levels

Descend at most levels (a non-negative integer) levels of directories below the command line arguments.

`-maxdepth 0' means only apply the tests and actions to the command line arguments
  #3 (permalink)  
Old 02-22-2001
jliebling jliebling is offline
Registered User
  
 

Join Date: Feb 2001
Location: Burbank, CA
Posts: 3
Thanks for the response.
However, as I mentioned in the initial posting, the -maxdepth does not seem to work on my system. See Below:

find . -maxdepth 0 -type f -mtime +2

find: 0652-017 -maxdepth is not a valid option.

Other ideas?

Or am I doing something wrong?

When I man find on my system, maxdepth is not shown...I only knew about it from searching around UNIX sites on the net.

Thanks again,
Julie
  #4 (permalink)  
Old 02-22-2001
Neo's Avatar
Neo Neo is offline Forum Staff  
Administrator
  
 

Join Date: Sep 2000
Location: Asia Pacific
Posts: 6,656
You may not be running GNU utilities. When I work on differnet flavors of UNIX like systems (HP-UX, Solaris) one of the first things I do is set up a development environment to compile GNU utilities for the platforms. The GNU compiler can compile for just about every OS on this planet (and maybe other planets!) You might find it faster to just build a GNU version of find (and then you will be set up for other builds in the future too!!)

The first challenge in this approach is to install a GNU C compiler for your platform. This can be trickly for newbies. However, if you can 'get through it', the rewards are great and very worthwhile.

Perhaps someone else will have a better reply if you state the exact version of find (and the platform).
  #5 (permalink)  
Old 02-22-2001
jliebling jliebling is offline
Registered User
  
 

Join Date: Feb 2001
Location: Burbank, CA
Posts: 3
I am working on AIX version 4.3.

I do not know that I can do what you suggested. I work for a very large company...don't know that I can just install things (I've only been here a few weeks).

Will try contacting the UNIX system admins (as soon as someone tells me who they are!) :-)

Thanks!

-Julie
  #6 (permalink)  
Old 02-22-2001
Neo's Avatar
Neo Neo is offline Forum Staff  
Administrator
  
 

Join Date: Sep 2000
Location: Asia Pacific
Posts: 6,656
Normally large companies will let qualified people set up a server to compile GNU utilities. This is normally done on a non-production development environment. However, if you are not the administrator, they may not like GNU or have other restrictions. These restrictions can really decrease productivity in most shops

However, senior UNIX folks can usually develop a good configuration management plan and show the cost-benefits of building a cross-platform GNU development environment. This is especially true if your shop has many different flavors of UNIX (linux, hpux, aix, etc.)
Sponsored Links
Closed Thread

Bookmarks

Tags
linux, 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 02:51 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