LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 12-11-2012, 10:59 PM   #1
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Rep: Reputation: 31
change file owner in a directory


I have a directory , many files from different users will copy files to it , so there are many file owners in this directory , if I would like to make all file owner are a specific user , that means once the files are copy to this different , then change its owner to a specific user , I know I an set a cron job , but it seems too last to change owner as I would like do it real time when the files are created .

can advise what can I do ?

thanks
 
Old 12-11-2012, 11:31 PM   #2
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Did you try anything so far? It can be done using chown cmd, with recurssive option:
Code:
chown -R new_owner /path/to/dir
Well, as far as I know, there's no way to change owner as soon as a new file gets created inside that directory. But in such situation, to protect data or for availability of data to all memebers of a group/project, you can go with SGID and Sticky bit utilities.

Last edited by shivaa; 12-11-2012 at 11:33 PM.
 
  


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
Owner of a directory different than file owner problems Guardian-Mage Linux - Server 4 04-24-2009 10:26 AM
nfs change owner during wwrite to directory vgulch Linux - Server 1 01-25-2008 03:57 AM
can't change owner of directory miner49er Linux - Networking 1 05-04-2006 03:58 PM
How to change owner and group in a directory to include subdir and all files Lakota Linux - General 2 07-15-2004 09:35 AM
file permissions and file owner won't change Nadim Slackware 5 11-29-2003 06:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:10 AM.

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
Open Source Consulting | Domain Registration