gzip many files one by one
6,465
To compress all files, you can use:
gzip n*.txt
The n*.txt
will expand to all file names as arguments for gzip
.
Related videos on Youtube
Author by
slhck
Updated on September 18, 2022Comments
-
slhck over 1 year
I have 100 files, n1.txt, n2.txt,… and I want to gzip each of them, but not in one file – finally I'd like to have 100
n*.txt.gz
files.How can I do that in Linux with Bash?
-
Kevin Versfeld about 11 yearsDid you check the man pages? They are great when you need to get help on the allowed syntax of a command.
-
jpaugh almost 6 yearsNote that gzip does not allow compressing multiple files into one archive, because it's not an archive format (only a compression format). For that, you need to use tar, and compress the resulting tar archive with gzip.
-