Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

tar removing leading '/' from member names

Tags:

I got an error when I append > /dev/null to tar command, anyone know what's going on in second example?

good:

 tar -cvf $kname /var/www 

bad:

 tar -cvf $kname /var/www > /dev/null   error:tar: Removing leading `/' from member names 
like image 587
Hebing Avatar asked Sep 19 '14 08:09

Hebing


People also ask

What does it mean tar removing leading '/' from member names?

tar: Removing leading `/' from member namesThis is a simple warning to tell you that it is writing a tar file without absolute paths. This is because you cannot then relocate the data at a later date when you unarchive the file. Most people simply ignore this warning.

What is tar XVFZ command?

$ tar xvzf file.tar.gz. 5. Creating compressed tar archive file in Linux using option -j : This command compresses and creates archive file less than the size of the gzip. Both compress and decompress takes more time then gzip.

What is tar option?

The GNU tar (short for Tape ARchiver) command is the most widely used archiving utility in Linux systems. Available directly in the terminal, the tar command helps create, extract, and list archive contents.


1 Answers

The "good" version is also displaying the same message you've just missed it.

If you don't like the behaviour, search for "leading", in manual. First hit:

-P, --absolute-names        don't strip leading '/'s from file names 
like image 96
Karoly Horvath Avatar answered Sep 22 '22 19:09

Karoly Horvath