grep multiple file
I want grep multiple files:
let abc.1.abc.2,abc.3,abc.4 I use grep <pattern> abc.* to read the files. But here grep read files in the order of 1,2,3,4 . I want to to grep the files in reverse order like 1st the abc.4 file will be read and abc.1 file will be last. Is this possible ? |
Hi,
grep xyz $(ls -r abc.*) Hope this helps. |
If your shell provides "brace expansion" you could use it:
Code:
grep <pattern> abc.{4..1} |
Quote:
|
grep multiple words
Thankyou so much for the solutions but its not working. I will try to elaborate by giving more examples.
file TOP.txt Foul Tall blot grail House System Galaxy jar trophy laptop This file contains 10 words Second file all.txt system ns01 broad ns02 house ns03 laptop ns04 trophy ns05 ginger ns06 foul ns07 dustbin ns08 mugs ns09 blot ns10 pack ns11 butter ns12 jar ns13 knife ns14 kangroo ns15 galaxy ns16 kind ns17 heart ns18 grail ns19 short ns20 tall ns21 table ns22 chair ns23 blot ns24 onion ns25 foul ns26 this file contains 26words with their codes, now what i want to do is to relate the top file words with the codes in all.txt files omiting the words which are not present in the top file. that is i want the result to look like this Result Foul ns26 Tall ns21 blot ns24 grail ns19 House ns03 System ns01 Galaxy ns16 jar ns13 trophy ns05 laptop ns04 two things important firstly words are not arranged alphabetically and secondly they are not case sensitive that is similar words might be in small alphabet in top file where as in capital in all file. I hape i have given the clear e.g. now |
@zonah12: You are already receiving answers in your other thread:
http://www.linuxquestions.org/questi...r-file-909296/ Please do not crosspost and keep the discussion in one place. |
All times are GMT -5. The time now is 05:49 AM. |