How to rename .tar.gz file without extracting the contents and creating the new .tar.gz file in UBUNTU?
11,902
The easiest is to simply rename ("move") the file:
mv Existing.tar.gz New.tar.gz
Related videos on Youtube
Comments
-
Madhu almost 2 years
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 existingExisting.tar.gz
file.Can anyone tell me, is there any way to rename the exiting file without creating the new one?
Thanks.
-
arkascha almost 7 yearsWhat about
mv Existing.tar.gz New.tar.gz
? -
arkascha almost 7 yearsAnd, btw, that command you gave does not unpack anything... It will try to create an archive
Existing.tar.gz
and place the fileNew.tar.gz
in it... Which certainly is not what you want.
-
-
Madhu almost 7 yearsThank you. this rename the existing file like how I wanted.
-
arkascha almost 7 yearsSure, you are welcome. And maybe a "pro tip" for you: take a look at the
apropos
utility: it allows you to discover commands you do not already know, so here themv
command. Try aapropos rename
and look through the result list. For each of those commands you can open the manual page with theman
utility, so here aman mv
to find out about the commands usage and details... -
arkascha almost 7 yearsGlad I could be of help! Then maybe you want to "accept" this answer ;-)