Avoid warning: tar: Removing leading `/' from member names

23 September 2025 - Thomas Damgaard

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 -Coption to have tar change directory to / before archiving.

Example:

tar -cf home.tar -C / home
Filed under: gnu, howto, linux, tar, tips

Back to article list