Linux 如何将 file_name.csv.gz 文件解压缩为 .csv

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17068197/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 23:12:01  来源:igfitidea点击:

How to unzip the file_name.csv.gz files to .csv

linuxbashshellunix

提问by Dileep

I want to Unzip the files, which are in *.csv.gz format to .csv format.

我想将 *.csv.gz 格式的文件解压缩为 .csv 格式。

when i tried with these Commands $ gzip -d file.gzand $ gzip -f file.gz, it is showing like

当我试图与这些命令$ gzip -d file.gz$ gzip -f file.gz,它显示像

gzip: IQ.gz: No such file or directory
gzip: Envoy.gz: No such file or directory
gzip: compressed data not read from a terminal. Use -f to force decompression.
For help, type: gzip -h

please help me on this to how to unzip.

请帮助我了解如何解压缩。

Thanks in advance.

提前致谢。

采纳答案by hd1

find . -name '*.csv.gz' -print0 | xargs -0 -n1 gzip -d

Should sort you, alternatively:

应该对你进行排序,或者:

find . -name '*.csv.gz' -exec gzip -d {} \;

will also work. These are recursive so they will go into subdirs.

也会起作用。这些是递归的,因此它们将进入子目录。