fgrep help please
Can you please give me information about fgrep?
What does the following command do? Code:
grep -f file1 file2 If I want to print common lines between two files, how can I do this with grep? |
Quote:
The grep manual page answers all your (other) questions. |
Yes I have tried this command.
I have two files with following contents. The file process.txt have Code:
12:24:37 up 59 min, 6 users, load average: 0.58, 1.64, 1.89 thunderbird back-up Code:
May 11 15:31 $ grep -f process.txt space.txt is same as cat space.txt I am not able to understand why does not it print common lines. |
Quote:
So...options:
|
fgrep is equivalent to grep -F, not grep -f
Code:
~$ fgrep <keyword> file1 file2 ## Same as grep -F Code:
-f FILE, --file=FILE |
@TB0ne & @shivaa
Thanks for your explanation. I got it. I think I should use diff or comm to print common lines, that would be much better. Thanks again. |
All times are GMT -5. The time now is 10:19 AM. |