![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| Can any body tell me. | sackNumchai | Linux | 3 | 05-06-2008 12:28 AM |
| need some help...can any body give some idea | sapan123 | Shell Programming and Scripting | 13 | 02-23-2008 03:19 PM |
| can any body give some idea on this.. | sapan123 | UNIX for Advanced & Expert Users | 1 | 10-21-2007 12:10 PM |
| can any body correct the code | vivekanandarpat | UNIX for Advanced & Expert Users | 2 | 09-16-2005 09:24 AM |
| Can any body correct the code | vivekanandarpat | Shell Programming and Scripting | 6 | 09-15-2005 02:16 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Can any body give me a solution to this...
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 |
|
|||||
|
see also on other time...
can you please help me out on this... You know, if you don't understand the response, or it is taking you in a direction that will not work for you, pose the question differently or something. |
|
||||
|
thats true..Could you please help me out on this...could you plse give me the solution for this...
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}' >> result.txt done it giving me result in result.txt as ...below.. 1 3 5 7 i mean the folder name.. but if i am using ${i}.txt then its give me in separate file..not in a single file...... |
|
||||
|
plz
i mean let say the path is A/B/C...and inside C...i have 1-10 folder...
i need to find the different file type from different folder and to print those results in single out file.. 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 give me output in 1.txt , 3.txt , 5.txt , 7.txt.. but i need the result in one file let say result.txt...if am putting result.txt in plase of ${i}.txt then i am getting result in result.txt as below 1 3 5 7 but here i need the file which contains in these folder 1,3,5,7 and print in result.txt.... |
|
||||
|
or let say...
A/B/C/1 2 3 4 5 6 7 8 9 10... i mean inside C i have 10 folder.. in 1- a.txt in 2- b.txt in 3- c.txt in 4- d.txt in 5- e.txt in 6- f.txt in 7- g.txt in 8- h.txt the syntax should give me the result in result.txt from 1,3,5,7 folder is... a.txt c.txt e.txt g.txt |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|