How can I recursively change the owner of a directory to the user nobody in linux
up vote
12
down vote
favorite
I would like to change the owner of a directory and all files and directories below it to the user nobody.
I have a /parent_dir with owner root. I want to change the owner to nobody (system user) recursively.
linux
migrated from stackoverflow.com Feb 23 '11 at 0:58
This question came from our site for professional and enthusiast programmers.
add a comment |
up vote
12
down vote
favorite
I would like to change the owner of a directory and all files and directories below it to the user nobody.
I have a /parent_dir with owner root. I want to change the owner to nobody (system user) recursively.
linux
migrated from stackoverflow.com Feb 23 '11 at 0:58
This question came from our site for professional and enthusiast programmers.
add a comment |
up vote
12
down vote
favorite
up vote
12
down vote
favorite
I would like to change the owner of a directory and all files and directories below it to the user nobody.
I have a /parent_dir with owner root. I want to change the owner to nobody (system user) recursively.
linux
I would like to change the owner of a directory and all files and directories below it to the user nobody.
I have a /parent_dir with owner root. I want to change the owner to nobody (system user) recursively.
linux
linux
edited Jul 25 '12 at 11:28
Paul
47.6k13119146
47.6k13119146
asked Feb 22 '11 at 17:33
jeny
migrated from stackoverflow.com Feb 23 '11 at 0:58
This question came from our site for professional and enthusiast programmers.
migrated from stackoverflow.com Feb 23 '11 at 0:58
This question came from our site for professional and enthusiast programmers.
add a comment |
add a comment |
4 Answers
4
active
oldest
votes
up vote
22
down vote
Like this:
sudo chown -R nobody /parent_dir
add a comment |
up vote
4
down vote
You may change the owner of the directory recursively using the following command. -R stands for recursive.
chown -R ownername foldername
You can also change the owner and group of the directory recursively using the following command.
chown -R ownername:groupname foldername
For more details refer this.
add a comment |
up vote
1
down vote
By using the -R command line parameter of chown.
chown -R nobody /parent_dir
add a comment |
up vote
1
down vote
Just as an alternative to the other answers:
sudo find /parent_dir -exec chown nobody {} ;
if you only want to change files you could use -type f or -type d for directories. comes in handy, when you want to chmod stuff.
another thing you can do here is restrict it to only change files from one particular owner to another. If only a few files are root owned that can save a lot of metadata writes.
– Bron Gondwana
Jul 25 '12 at 11:57
add a comment |
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
22
down vote
Like this:
sudo chown -R nobody /parent_dir
add a comment |
up vote
22
down vote
Like this:
sudo chown -R nobody /parent_dir
add a comment |
up vote
22
down vote
up vote
22
down vote
Like this:
sudo chown -R nobody /parent_dir
Like this:
sudo chown -R nobody /parent_dir
answered Feb 22 '11 at 17:35
shellholic
6,2571108
6,2571108
add a comment |
add a comment |
up vote
4
down vote
You may change the owner of the directory recursively using the following command. -R stands for recursive.
chown -R ownername foldername
You can also change the owner and group of the directory recursively using the following command.
chown -R ownername:groupname foldername
For more details refer this.
add a comment |
up vote
4
down vote
You may change the owner of the directory recursively using the following command. -R stands for recursive.
chown -R ownername foldername
You can also change the owner and group of the directory recursively using the following command.
chown -R ownername:groupname foldername
For more details refer this.
add a comment |
up vote
4
down vote
up vote
4
down vote
You may change the owner of the directory recursively using the following command. -R stands for recursive.
chown -R ownername foldername
You can also change the owner and group of the directory recursively using the following command.
chown -R ownername:groupname foldername
For more details refer this.
You may change the owner of the directory recursively using the following command. -R stands for recursive.
chown -R ownername foldername
You can also change the owner and group of the directory recursively using the following command.
chown -R ownername:groupname foldername
For more details refer this.
edited Nov 14 at 10:43
answered Oct 14 '14 at 5:46
Mahendran Sakkarai
1414
1414
add a comment |
add a comment |
up vote
1
down vote
By using the -R command line parameter of chown.
chown -R nobody /parent_dir
add a comment |
up vote
1
down vote
By using the -R command line parameter of chown.
chown -R nobody /parent_dir
add a comment |
up vote
1
down vote
up vote
1
down vote
By using the -R command line parameter of chown.
chown -R nobody /parent_dir
By using the -R command line parameter of chown.
chown -R nobody /parent_dir
edited Jul 10 '11 at 5:09
3498DB
15.6k114761
15.6k114761
answered Feb 22 '11 at 17:35
filmor
1165
1165
add a comment |
add a comment |
up vote
1
down vote
Just as an alternative to the other answers:
sudo find /parent_dir -exec chown nobody {} ;
if you only want to change files you could use -type f or -type d for directories. comes in handy, when you want to chmod stuff.
another thing you can do here is restrict it to only change files from one particular owner to another. If only a few files are root owned that can save a lot of metadata writes.
– Bron Gondwana
Jul 25 '12 at 11:57
add a comment |
up vote
1
down vote
Just as an alternative to the other answers:
sudo find /parent_dir -exec chown nobody {} ;
if you only want to change files you could use -type f or -type d for directories. comes in handy, when you want to chmod stuff.
another thing you can do here is restrict it to only change files from one particular owner to another. If only a few files are root owned that can save a lot of metadata writes.
– Bron Gondwana
Jul 25 '12 at 11:57
add a comment |
up vote
1
down vote
up vote
1
down vote
Just as an alternative to the other answers:
sudo find /parent_dir -exec chown nobody {} ;
if you only want to change files you could use -type f or -type d for directories. comes in handy, when you want to chmod stuff.
Just as an alternative to the other answers:
sudo find /parent_dir -exec chown nobody {} ;
if you only want to change files you could use -type f or -type d for directories. comes in handy, when you want to chmod stuff.
edited Jul 25 '12 at 11:56
answered Jul 25 '12 at 11:50
Baarn
5,25652659
5,25652659
another thing you can do here is restrict it to only change files from one particular owner to another. If only a few files are root owned that can save a lot of metadata writes.
– Bron Gondwana
Jul 25 '12 at 11:57
add a comment |
another thing you can do here is restrict it to only change files from one particular owner to another. If only a few files are root owned that can save a lot of metadata writes.
– Bron Gondwana
Jul 25 '12 at 11:57
another thing you can do here is restrict it to only change files from one particular owner to another. If only a few files are root owned that can save a lot of metadata writes.
– Bron Gondwana
Jul 25 '12 at 11:57
another thing you can do here is restrict it to only change files from one particular owner to another. If only a few files are root owned that can save a lot of metadata writes.
– Bron Gondwana
Jul 25 '12 at 11:57
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f249170%2fhow-can-i-recursively-change-the-owner-of-a-directory-to-the-user-nobody-in-linu%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown