Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 12-11-2012, 11:59 PM   #1
Senior Member
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Rep: Reputation: 30
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 ?

Old 12-12-2012, 12:31 AM   #2
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:
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-12-2012 at 12:33 AM.


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

All times are GMT -5. The time now is 09:40 AM.

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