Results 1 to 6 of 6
Hi I was wondering if this is the correct command when I want to do 'grep' on multiple files in the same folder
cat 1.txt | cat 2.txt | cat ...
- 10-06-2011 #1Just Joined!
- Join Date
- Oct 2011
- Posts
- 3
What's the linux command to do 'grep' on multiple file????
Hi I was wondering if this is the correct command when I want to do 'grep' on multiple files in the same folder
cat 1.txt | cat 2.txt | cat 3.txt |cat 4.txt |grep text
Thanks!
- 10-06-2011 #2
no.
but grep can do it natively, and even recursiveYou must always face the curtain with a bow.
- 10-06-2011 #3Just Joined!
- Join Date
- Oct 2011
- Posts
- 3
but this code can still perform the function I need right? if not can you please let me know the correct command?? Thanks!
- 10-06-2011 #4
No, your approach would only grep in 4.txt.
You can probably figure out the correct command yourself.
Hint: You only need grep and your four txt files.
Code:man grep
You must always face the curtain with a bow.
- 10-06-2011 #5Just Joined!
- Join Date
- Oct 2011
- Posts
- 3
Thank you!
I change the command to cat 1.txt 2.txt 3.txt 4.txt |grep text
- 10-06-2011 #6
You dont need cat
You must always face the curtain with a bow.


Reply With Quote