Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

find command

Status
Not open for further replies.

hok1man

Technical User
Feb 16, 2008
102
guys,

how to find file with maxdepth 1 in unix?
I would like something like this in GNU
Code:
find . -type f -mtime -5 -maxdepth 1 | xargs ls -lrt
how do I do that in unix?
Thanks guys
 
same thing elgrandeperro,
in unix we don't have -maxdepth option
 
Try this:

[tt]find . -type f -mtime -5 -print -o ! -name '.' -type d -prune[/tt]

I'm sure there must be a simpler way, but finds logic is... confusing!

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top