gunzip multiple gz files with same compressed file name in multiple folders
3
votes
2
answers
1171
views
I have a directory where there are multiple folders, each folder contains multiple .gz files with the same zipped file name "spark.log". How can I unzip all of them at once and rename them like the gz file?
My data looks like this
List of folders
A
B
C
D
In every of them there are files as
A
spark.log.gz
spark.log.1.gz
spark.log.2.gz
spark.log.3.gz
B
spark.log.gz
spark.log.1.gz
spark.log.2.gz
spark.log.3.gz
C
spark.log.gz
spark.log.1.gz
spark.log.2.gz
spark.log.3.gz
D
spark.log.gz
spark.log.1.gz
spark.log.2.gz
spark.log.3.gz
in each of the gz file contains
spark.log
, I'd like to be able to unzip and rename them according to their gz name. For example:
spark.log.1.gz
-> spark.log.1.log
Asked by sojim2
(143 rep)
Oct 7, 2022, 12:30 AM
Last activity: Oct 10, 2022, 03:16 PM
Last activity: Oct 10, 2022, 03:16 PM