Mailing List ArchiveSupport open source code!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: tar and permissions
- To: tlug@example.com
- Subject: Re: tar and permissions
- From: Bruno Raoult <braoult@example.com>
- Date: Wed, 24 Oct 2001 22:01:40 +0900
- Content-transfer-encoding: 7bit
- Content-type: text/plain; charset=us-ascii; format=flowed
- Delivered-to: tlug@example.com
- List-help: <mailto:tlug-request@example.comsubject=help>
- List-post: <mailto:tlug@example.com>
- List-subscribe: <mailto:tlug-request@example.comsubject=subscribe>
- List-unsubscribe: <mailto:tlug-request@example.comsubject=unsubscribe>
- Old-return-path: <braoult@example.com>
- References: <20011024201825.C69B.AKAMINE@example.com>
- Reply-to: tlug@example.com
- Resent-from: tlug@example.com
- Resent-message-id: <Lc07u.A.6sD.ysr17@example.com>
- Resent-sender: tlug-request@example.com
- User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.5) Gecko/20011012
Hector Akamine wrote: >Hi, > >I am confused about the meaning of the "preserve permissions" (-p) >switch in tar. According to what I have read, using -p keeps the file >permissions as the original files. Then, what happens when I use tar without >-p? > >I want to copy the contents of some user's directory using tar. I think >I should make the operation as root. If I use -p, will it keep the >file-directory permissions and owners as the original ones? What happens >if I don't use -p? > > >Thanks in advance > Here is an example of the difference using or not -p. This is linked to umask. Not using -p could give files more restrictive permissions to file, depending on umask value. pern br> mkdir tar pern br> cd tar pern br> touch foo pern br> ls -l total 0 -rw-r--r-- 1 br users 0 Oct 24 21:52 foo pern br> tar cvf foo.tar foo foo pern br> mv foo foo.orig pern br> umask 777 pern br> tar xpvf foo.tar foo pern br> mv foo foo-p pern br> tar xpvf foo.tar foo 123 pern br> ls -l total 12 ---------- 1 br users 0 Oct 24 21:52 foo -rw-r--r-- 1 br users 0 Oct 24 21:52 foo-p -rw-r--r-- 1 br users 0 Oct 24 21:52 foo.orig -rw-rw-rw- 1 br users 10240 Oct 24 21:53 foo.tar
- Follow-Ups:
- Re: tar and permissions
- From: Bruno Raoult <braoult@example.com>
- References:
- tar and permissions
- From: Hector Akamine <akamine@example.com>
Home | Main Index | Thread Index
- Prev by Date: tar and permissions
- Next by Date: Re: tar and permissions
- Previous by thread: tar and permissions
- Next by thread: Re: tar and permissions
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links