Artificial intelligent assistant

Linux & Bash Chromosomes sorting files I need to combine all the files with genomic data in that particular way. It means it should be sorted first by numbers then alphabetically. The names of files are: Homo_sapiens.GRCh38.dna.chromosome.1.fa.gz Homo_sapiens.GRCh38.dna.chromosome.2.fa.gz Homo_sapiens.GRCh38.dna.chromosome.3.fa.gz etc. Homo_sapiens.GRCh38.dna.chromosome.11.fa.gz Homo_sapiens.GRCh38.dna.chromosome.13.fa.gz etc. Homo_sapiens.GRCh38.dna.chromosome.X.fa.gz Homo_sapiens.GRCh38.dna.chromosome.Y.fa.gz I need to do it in bash as easy as possible; with no scripts etc.. I try to use `sort -V` and the others but it's still doesn't work. Any ideas? 8)

Try


ls | sort -V -d


It returns


Homo_sapiens.GRCh38.dna.chromosome.1.fa.gz
Homo_sapiens.GRCh38.dna.chromosome.9.fa.gz
Homo_sapiens.GRCh38.dna.chromosome.13.fa.gz
Homo_sapiens.GRCh38.dna.chromosome.19.fa.gz
Homo_sapiens.GRCh38.dna.chromosome.X.fa.gz


I tried experimenting with `-V` option because it should natively handle "X" at the end and when you remove the dot before the character where numbering starts, it works. I wonder why though :)

EDIT: The reason why `-V` option does not sort properly is given on GNU Coreutils's website (firstly, it is only dedicated for numbered/indexed versions.

<

Cheers

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy b1f5995591d4548b4b95fc55ec2ba87c