Linux 从脚本解压文件而不输出解压文件名

Jim*_*834 4 command-line scripts zip unzip

我用“unzip filename.zip”从脚本中解压了一个文件,在终端中我看到了所有解压后的文件名。我想解压缩文件而不打印这些名称,以便我有一个干净的终端界面。

ste*_*ver 7

MODIFIERS部分man unzip

-q     perform  operations  quietly  (-qq  = even quieter).  Ordinarily
       unzip prints the names of the files it's extracting or  testing,
       the extraction methods, any file or zipfile comments that may be
       stored in the archive, and possibly a summary when finished with
       each  archive.   The -q[q] options suppress the printing of some
       or all of these messages.
Run Code Online (Sandbox Code Playgroud)

所以

unzip -q filename.zip
Run Code Online (Sandbox Code Playgroud)

  • @Jim6834 你指的是标准的 `mv` 和 `cp` 命令吗?如果是这样,那么 AFAIK 默认情况下他们不会报告成功的操作(他们使用 `-v` 来增加详细程度,而不是使用 `-q` 来减少它)。或者您是否以其他方式移动/复制文件? (3认同)