Can `tar --list -v` list file size in human-readable format?
There's no built-in tar
option, but you can filter its output. For example, using humanize:
#!/usr/bin/env python
import fileinput
import humanize
for line in fileinput.input():
(perm, owner, size, date, time, filename) = tuple(line.split())
print '{0} {1} {2:>9} {3} {4} {5}'.format(perm, owner, humanize.naturalsize(size, gnu=True), date, time, filename)
Save this as e.g. humantvf
, then
tar tvf ... | ./humantvf