It's got perhaps several dozen headers to read through and print out, followed by perhaps several hundred million alignment records to read though. I'm sure it will finish if you wait long enough!
Perhaps you should consider samtools view -H or similar.
what's in
filename
? a BAM?