List the content of tape file

用 tar 打包后可以使用 -tvf 参数来查看包中的文件,但当文件特别多的时候就会列出很长一串,有时候我们仅仅需要查看一级目录,这是就需要配合 awk 来实现了

tar tvf /dev/st0 | awk -F/ '{if (NF<4) print }'

One thought on “List the content of tape file”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.