The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
need urgent help namishtiwari Shell Programming and Scripting 10 02-18-2008 05:42 AM
Urgent Help With Sed katrvu Shell Programming and Scripting 10 02-07-2008 08:43 PM
URGENT,URGENT- Need help tape drive installation sriny UNIX for Advanced & Expert Users 3 11-16-2006 12:43 PM
URGENT---URGENT--No OK PROMPt after RSC CONFIG sriny SUN Solaris 7 10-29-2006 08:06 AM
Urgent !! desiondarun UNIX for Dummies Questions & Answers 1 08-08-2006 05:49 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 07-15-2008
Read Only
 

Join Date: Oct 2007
Posts: 39
need help urgent...........

Hi friends..
I am using the below command to search few files from many folders which is under one folder..

i mean let say the path is A/B/C...and inside C...i have 1-10 folder...

the below command is working fine....

for i in 1 3 5 7; do
find /A/B/C/${i} -name "*.txt" -o -name "*.csv" -o -name "*.TXT" -o -name "*.dat" |xargs ls -ltr |awk '{print $8 ,$9}' >> ${i}.txt
done

this will give me the result from the folder 1 3 5 7 ,from 1-10 which is inside A/B/C[/b] and print the file having the above extension into 1.txt , 3.txt , 5.txt , 7.txt etc inside /A/B/C

Help needed..

i need some help so that my syntax will search the file only from folder 1,3,5,7 from the 10 folder A/B/C and the out put from these 4 folder will be display in the single file i.e result.txt....not in different folder.

the above 1,3,5,7 folders are inside A/B/C
Forum Sponsor
  #2  
Old 07-15-2008
jhtrice's Avatar
Registered User
 

Join Date: Jun 2008
Posts: 63
Not sure what you mean. Is something like this what you are looking for?


rm -f result.txt
for i in 1 3 5 7; do
find /A/B/C/${i} ! -path /A/B/C/${i} -prune -name "*.txt" -o -name "*.csv" -o -name "*.TXT" -o -name "*.dat" |xargs ls -ltr |awk '{print $8 ,$9}' >> result.txt
done
  #3  
Old 07-15-2008
Ikon's Avatar
Registered User
 

Join Date: Jul 2008
Location: Phoenix, Arizona
Posts: 404
How many times are you going to post the same question???

You will get less help from the community because of this.. Either abide by the rules or leave!

can any body help me out on this...

Can any body give me a solution to this...

need help urgent...........
  #4  
Old 07-15-2008
Moderator
 

Join Date: Feb 2007
Posts: 2,328
Quote:
Originally Posted by Ikon View Post
How many times are you going to post the same question???

You will get less help from the community because of this.. Either abide by the rules or leave!

can any body help me out on this...

Can any body give me a solution to this...

need help urgent...........

Thread closed.
Google The UNIX and Linux Forums
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 02:50 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0