我在许多网站上见过像这样的命令,"-zxvf"或类似命令代表什么意思?
tar -zxvf <filename>
tar xvf <filename>
不必深入了解所有选项的描述,您可以在info tar
命令下跳转到3.4.3短选项交叉引用
。
x
表示--extract
。 v
表示--verbose
。 f
表示--file
。 z
表示--gzip
。 您可以将单个字母参数组合在一起,f
需要一个参数,即文件名。 有一些需要注意的事情:
Short options' letters may be clumped together, but you are not required to do this (as compared to old options; see below). When short options are clumped as a set, use one (single) dash for them all, e.g., ''tar' -cvf'. Only the last option in such a set is allowed to have an argument(1).
This old way of writing 'tar' options can surprise even experienced users. For example, the two commands:tar cfz archive.tar.gz file tar -cfz archive.tar.gz file
are quite different. The first example uses 'archive.tar.gz' as the value for option 'f' and recognizes the option 'z'. The second example, however, uses 'z' as the value for option 'f' -- probably not what was intended.
tar --help
或man tar
。确实如此。这也与编程无关,让我们快速结束它。 - DevSolar