The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
help me out with find command , -prune option bhuvaneshlal UNIX for Dummies Questions & Answers 7 09-08-2009 05:26 AM
doubt in -prune option bhuvaneshlal Linux 0 08-21-2009 05:16 PM
correct usage of find's -prune option ProGrammar SUN Solaris 6 04-29-2009 01:22 PM
find with prune option highlt UNIX for Advanced & Expert Users 11 01-04-2007 11:29 AM
finding files using prune option subodh.sharma Shell Programming and Scripting 1 11-02-2005 11:11 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 10-01-2009
apsprabhu apsprabhu is offline
Registered User
  
 

Join Date: Feb 2008
Location: India
Posts: 45
find with prune option

Hi,

I want to list files only from the current dir and its child dir (not from child's child dir).

i have the following files,

Code:
./ABC/1.log
./ABC/2.log
./ABC/ABC1/A.log
./ABC/ABC1/B.log
./ABC/ABC1/XYZ/A1.log
./ABC/ABC1/XYZ/A2.log

Here i want to list only the log file from current dir and ./ABC dir. ( not from ./ABC/ABC1 and ./ABC/ABC1/XYZ).


Hence please someone help me to write a correct find command with -prune option.
I beleive the following command will work in Linux find . -name "*.log" -maxdepth 1. But this command is not working in AIX. I'm not sure -maxdepth option is shell dependent or unix flavour variant.

SO i tried find with -prune option but that is not giving me the desired result. (i'm not pretty sure if my find command with -prune option is correct)

Last edited by zaxxon; 10-01-2009 at 02:03 AM.. Reason: code tags
 

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 08:53 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