Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 01-09-2003, 01:43 AM   #1
Registered: Sep 2002
Location: fdas
Posts: 100

Rep: Reputation: 15
Preserve the ownership

After I gzip a file , then gunzip the file , the owner will be changed to me , how can I preserve the ownership to the original owner.


# ll abc.prn
-rw-rw-rw- UserA abc.prn
# whoami
# gzip abc.prn
# ll
-rw-rw-rw- UserB abc.prn.gz
#gunzip abc.prn.gz
-rw-rw-rw- UserB abc.prn

How to preserve the owner of the file abc.prn to original owner ( UserA) ? Thx.
Old 01-16-2003, 01:38 PM   #2
LQ Guru
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 235Reputation: 235Reputation: 235
Most likely this isn't possible, cause if a regular user had the power to create a file that another person owns, what would prevent that person to gain access to anything the other owner has that maybe he doesn't want anyone to have access to.

Your best option is to either su to the other user to gzip the file or just change the ownership, etc afterwards.


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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
preserve file ownership with the "zip" command? zovres Linux - General 2 11-25-2004 09:01 PM
I want to preserve a pid linuxprogrammer Linux - Newbie 4 07-23-2004 09:55 AM
preserve links jmr71769 Debian 2 04-22-2004 10:01 AM
Why doesn't "cp -p <file>" copy <file> and preserve ownership? davidas Linux - Newbie 5 04-12-2004 05:44 AM
preserve the ownership juno Linux - General 5 01-08-2003 11:01 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:28 PM.

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