0

I have a directory with thousands of files .gz and I would like to uncompress and save the uncompressed files in a specific directory.

I have tried but I can get it (beginner in this field).

Thanks

2
  • What have you tried? Commented Mar 8, 2020 at 16:01
  • Welcome to the site. Please edit your question to include more information on how you want to accomplish the task. Are you looking for a console- or GUI-based approach? Is there only one target directory, or one per .gz file?
    – AdminBee
    Commented Mar 9, 2020 at 12:45

1 Answer 1

0

Try something like:

mkdir destination
cd destination
for g in ../origin/*.gz; do      # Each *.gz file in origin...
   gzcat $g > ${g##../origin/}   # ... gets uncompressed to here
done

With thousands of files, the glob (../origin/*.gz) might choke... and the destination directory might also get very slow.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .