grep with -f switch is not working
0
0
Entering edit mode
4.4 years ago
3335098459 ▴ 30

Hi,

I have multiple gene Ids or labels in a file. I want to use grep -f file.txt *.aln to find out in which alignment files my genes are present. I have tried grep --help and the -f switch is mentioned there. But the problem is: this command is not working in my linux system. Could anybody explain this? Is there any particular format required for this kind of command?

grep -f file.txt directory/path/*.aln

Regards

Awan

grep • 1.2k views
ADD COMMENT
2
Entering edit mode

this command is not working in my linux system

This is most uninformative => Why is it not working?

ADD REPLY
0
Entering edit mode

I don't know. Whenever I entered this command and pressed enter. The cursor moves to the next line but nothing happens. I mean no results are being shown.

ADD REPLY
2
Entering edit mode

Please show some effort, show data examples, show what is inside these files. How are we supposed to help without knowing details?

ADD REPLY
2
Entering edit mode

This means its still running. Are either of your files very large?

ADD REPLY
1
Entering edit mode

This souds most plausible. Also, grep is probably the slowest/most inefficient possible way to do this..

ADD REPLY
0
Entering edit mode

However, I have used a less algorithmic way. I have replaced all the spaces and tabs with -e and made a long command with all the labels having -e switch, the path to the directory and used grep. It worked fine. But still, I want to figure out this.

ADD REPLY
1
Entering edit mode

well, that is the answer then! whatever you are grepping in that file doesn't match anything in the given directory due to spectial symbols and so!

ADD REPLY

Login before adding your answer.

Traffic: 2025 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6