How to rename .tar.gz file without extracting the contents and creating the new .tar.gz file in UBUNTU?

Madhu picture Madhu · Jun 15, 2017 · Viewed 10.1k times · Source

I have a command which will create a new .tar.gz file from the existing one,

 sudo tar -zcvf Existing.tar.gz New.tar.gz

this command will create a new New.tar.gz file from the existing Existing.tar.gz file.

Can anyone tell me, is there any way to rename the exiting file without creating the new one?

Thanks.

Answer

arkascha picture arkascha · Jun 15, 2017

The easiest is to simply rename ("move") the file:

mv Existing.tar.gz New.tar.gz