When archiving absolute paths like /home
or /etc
, tar
will show a warning like this:
tar: Removing leading `/' from member names
This is often annoying as this behavior (removing /
from paths inside the archive) is well-known and desired.
We don’t need to see a warning about this.
An elegant way of avoiding this is to use the -C
option to have tar
change directory to /
before archiving.
Example:
tar -cf home.tar -C / home