Hello!
What is the best way to find common elements between 2 columns using BASH?
Hello!
What is the best way to find common elements between 2 columns using BASH?
Biostars is not a code service - we generally will not provide code for you if you show no effort. In general, you should show what you tried and exactly what issues you're having. Here, you have at least provided a reproducible example, which is good. This is a fairly easy operation via awk
(or many other methods) that can easily be found via google. As a warning, questions like this that show no effort may very well be closed in the future, but the following should work for you.
awk 'NR==FNR{c[$1]++;next};c[$1]' DEGs.txt all.genes.txt > output.txt
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Of course, right as I post my answer below, you've edited the question and removed your reproducible example. That information should have been left in your post.