grep with -f switch is not working
0
0
Entering edit mode
16 months 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 • 347 views
2
Entering edit mode

this command is not working in my linux system

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

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.

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?

2
Entering edit mode

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

1
Entering edit mode

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

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.

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!