![]() |
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. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
can you please help me out on 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.... find /A/B/C -name "*.txt" -o -name "*.csv" -o -name "*.TXT" -o -name "*.dat" |xargs ls -ltr |awk '{print $8 ,$9}' > result.txt this will give me the result from the folder 1-10 which is inside A/B/C and print the file having the above extension into result.txt... Help needed.. i need the syntax so that my syntax will search the file only from folder 1,3,5,7 and the out put from these 4 folder will be display in the single file i.e result.txt.... the above 1,3,5,7 folders are inside A/B/C Thanks in advance.... |
|
||||
|
Friend one more thing...
As you mentioned 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 so the out put file will be ??????? |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|