LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-03-2013, 12:31 AM   #1
Aarif
LQ Newbie
 
Registered: Nov 2012
Posts: 10

Rep: Reputation: Disabled
tar: removing leading '/' from member names


i am trying to take a tar by command as below.
tar -cvf app-bkp040413.tar /home/user/app

the tar is created with the following warning
tar: removing leading '/' from member names

how can i overcome this.
TIA
Arif
 
Old 04-03-2013, 01:52 AM   #2
kooru
Senior Member
 
Registered: Sep 2012
Posts: 1,385

Rep: Reputation: 273Reputation: 273Reputation: 273
from "man tar"

Code:
 -P, --absolute-names
              don't strip leading `/'s from file names
 
1 members found this post helpful.
Old 04-03-2013, 02:10 AM   #3
Aarif
LQ Newbie
 
Registered: Nov 2012
Posts: 10

Original Poster
Rep: Reputation: Disabled
appreciated. thnx

so do i need to use "P" again while extracting the tar file?

Also found that the size of tar file is different when used with "P" option and otherwise.
 
Old 04-03-2013, 02:22 AM   #4
kooru
Senior Member
 
Registered: Sep 2012
Posts: 1,385

Rep: Reputation: 273Reputation: 273Reputation: 273
Quote:
Originally Posted by Aarif View Post
so do i need to use "P" again while extracting the tar file?
yes
 
1 members found this post helpful.
Old 04-03-2013, 08:24 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,356

Rep: Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367
The problem with using -P will be it will restore to the exact same place, overwriting anything already there. You don't always want that, so it defaults to stripping the leading '/' so you can re-locate the files anywhere and maybe just pick out stuff you want or diff the files from the extant ones.
 
Old 04-03-2013, 08:43 PM   #6
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,188

Rep: Reputation: 1184Reputation: 1184Reputation: 1184Reputation: 1184Reputation: 1184Reputation: 1184Reputation: 1184Reputation: 1184Reputation: 1184
By the way cpio, works this way by default. However common cpio formats odc and newc have file size limitations that make them unsuited for backups on modern systems. However some cpio implementations, such as bsdcpio (part of libarchive) can output in modern formats (e.g. pax) without such limitations.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
/bin/tar: Removing leading `/' from member names guarriman Linux - General 16 02-09-2010 08:19 PM
/bin/tar: Removing leading `/' from member names IFeelYourPain Linux - General 11 12-01-2007 02:32 PM
tar: Removing leading `/' means? packets Linux - Newbie 3 11-08-2007 07:17 PM
tar problem - Removing leading / from hard link targets rajeshkahara Linux - Software 2 01-05-2006 01:33 PM
Problem with tar - Removing leading / from hard link targets rajeshkahara Linux - Software 4 01-03-2006 04:22 AM


All times are GMT -5. The time now is 06:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration