This does not work because you need to get the taxID's at a lower lever than insecta.
$ blastdbcmd -db nr -taxids 50557 -outfmt %f
Error: [blastdbcmd] Taxonomy ID(s) not found. This could be because the ID(s) provided are not at or below the species level. Please use get_species_taxids.sh to get taxids for nodes higher than species (see https://www.ncbi.nlm.nih.gov/books/NBK546209/).
You can do (you may need to install EntrezDirect):
$ get_species_taxids.sh -t 50557 >insect.id
This will get the insect taxID. Then retrieve the fasta data (only showing you the headers below)
$ blastdbcmd -db nr -taxidlist insect.id -outfmt %f | grep "^>" | head -3
>XP_035731174.1 growth arrest-specific protein 2-like [Vespa mandarinia]
>KAJ3664018.1 hypothetical protein Zmor_008225 [Zophobas morio]
>KAH8395558.1 hypothetical protein KR222_011244 [Zaprionus bogoriensis]
Another option:
If you have the nr database downloaded you could limit the blast searches to insect taxID's using taxidlist option. Use the insect.id file generated above.
also BLAST Database error: No alias or index file found for protein database [nr] in search path [/mnt/d/blast/ncbi-blast-2.14.1+/bin::] I got this message..
Unless you are in the directory where the
nrdatabase is located (you seem to be in/mnt/d/blast/ncbi-blast-2.14.1+/bin), theblastdbcmdcommand will not work. Either you define a BLASTDB variable - see here - or type a full path to thenrdatabase such as/mnt/c/db/nrby using the actual location instead of my made-up example.