Reputation: 345
I have some files to tar
for example
abc.php_mtime_size
now i want to TAR this file such that when I untar it will have a name "abc.php"
so is there any way by which I can specify output file name as well while creating the TAR file.
Upvotes: 0
Views: 185
Reputation: 509
Try the following set/sequence of commands: assuming your original file is a.b_backup...you can try this..
$ tar -cvf test.tar a.b_backup
$ tar --transform='s/_backup//' -xf test.tar
$ ls
a.b
a.b_backup
Upvotes: 2
Reputation: 7213
Perhaps you should rename the file to its desired name before you tar it.
Upvotes: 1