0

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

originalname.csv.gz
1
  • 3
    for f in *.csv; do gzip "$f"; done
    – jordanm
    Jun 23, 2015 at 18:44

1 Answer 1

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
$> 

You must log in to answer this question.

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