tar zxvf 和 tar -zxvf 有什么区别?

What is the difference between tar zxvf and tar -zxvf?

今天我尝试在Linux中解压一个文件,我用了2种命令

1.tar zxvf zookeeper-3.4.6.tar.gz
2.tar -zxvf zookeeper-3.4.6.tar.gz

两个订单好像一样,有什么不同吗?

破折号是可选的,不会改变命令的含义。以下是 GNU tar 手册页的摘录:

The first argument to tar should be a function; either one of the letters Acdrtux, or one of the long function names. A function letter need not be prefixed with -, and may be combined with other single-letter options.

在您的例子中,您将函数字母 x 与单字母选项 zvf.

组合在一起