0

I have hundreds of .csv files that I need to compress into one file each. It should look like this

originalname.csv.gz
  • 2
    for f in *.csv; do gzip "$f"; done – jordanm Jun 23 '15 at 18:44
5
$> ls -la *csv
-rw-rw-r-- 1 user at 0 Jun 23 15:22 1.csv
-rw-rw-r-- 1 user at 0 Jun 23 15:22 2.csv
-rw-rw-r-- 1 user at 0 Jun 23 15:22 3.csv
$> gzip *csv
$> ls -la *csv*
-rw-rw-r-- 1 user at 26 Jun 23 15:22 1.csv.gz
-rw-rw-r-- 1 user at 26 Jun 23 15:22 2.csv.gz
-rw-rw-r-- 1 user at 26 Jun 23 15:22 3.csv.gz
$> 
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.