Gzip question

Alright, guys working on some school work and this one has me stumped, using gzip I need to compress a file named date.txt using the syntax gzip /FinalPractice/date.txt works but yields date.txt.gz my question is how can I accomplish this but have the name be date.gz

Thanks so much for any help!

You can do this by simply redirecting the output of the gzip command and piping it to a new file called data.gz like this:

gzip -c /path/to/file/date.txt > date.gz

Amazing! That was it, my finish syntax worked. I really appreciate it!

1 Like

Great happy to help :smiley: