Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
2  
Did you check the man pages? They are great when you need to get help on the allowed syntax of a command. –  mdpc Feb 18 '13 at 19:45

1 Answer 1

To compress all files, you can use:

gzip n*.txt

The n*.txt will expand to all file names as arguments for gzip.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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