I use this command to list all files in an archive:
tar jtvf blah.tar.bz2
How to list them sorted by size? Or list only the biggest files (i.e. files bigger than, say, 10MB)?
list files, filter by size, print only size+space+path, and sort by size only, descending order:
size=10485760
tar tvf blah.tar.bz2 \
| awk -v size="$size" '$3 >= size {print $3" "$6}' \
| sort -t' ' -k1,1nr
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With