Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to unzip the file_name.csv.gz files to .csv [closed]

I want to unzip files which are in *.csv.gz format to .csv format.

When I tried with these commands $ gzip -d file.gz and $ gzip -f file.gz, it is showing like

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.

like image 626
Dileep Avatar asked Jun 12 '13 14:06

Dileep


1 Answers

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.

like image 113
hd1 Avatar answered Oct 27 '22 22:10

hd1