cp -p and permissions | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

cp -p and permissions

UNIX for Dummies Questions & Answers


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 04-15-2002
penguin-friend
Guest
 
Posts: n/a
cp -p and permissions

Hi all.
Her's what i want to do:
-> copy a file from /tmp to /usr/local/bin, and then give this file the default owner of /usr/local/bin.
My /usr/local/bin belongs to root:sys. When i detar the file mentionned, it keeps the rights it was created with.
How can i achieve what i want to do? A cp -p does not give the file the rights of the new directory...
This is something i'm doing over 400 servers..

Thanx
Sponsored Links
    #2  
Old 04-15-2002
Kelam_Magnus's Avatar
Kelam_Magnus Kelam_Magnus is offline Forum Advisor  
Registered User
 
Join Date: Aug 2001
Last Activity: 18 April 2013, 3:03 PM EDT
Location: San Antonio, TX,
Posts: 1,070
Thanks: 0
Thanked 4 Times in 4 Posts
The -p option preserves the orignal ownership of the file and datestamp and group rights.

If you just want to change the file ownership and group as you copy it to the new directory, do this.

cp /tmp/file1 /usr/local/bin; chown root:sys file1
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
ksh; Change file permissions, update file, change permissions back? right_coaster Shell Programming and Scripting 3 09-30-2011 08:59 AM
permissions BeefStu Shell Programming and Scripting 1 11-15-2010 12:42 PM
permissions on ftp... aneuryzma UNIX for Dummies Questions & Answers 1 09-03-2009 04:42 AM
To give the "unzip" permissions & "create" file permissions Mike1234 HP-UX 3 03-02-2008 04:34 PM
help with permissions finster UNIX for Dummies Questions & Answers 2 04-09-2003 09:01 AM



All times are GMT -4. The time now is 09:58 AM.