Search code examples
linuxubuntuterminalserve

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


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.


Solution

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

    mv Existing.tar.gz New.tar.gz