Download your favorite Linux distribution at LQ ISO.
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 02-01-2005, 12:48 AM   #1
LQ Newbie
Registered: Jan 2005
Location: ACT, Australia
Posts: 16

Rep: Reputation: 0
Changing owner of a directory recursively?

How would I change the ownership of a certain directory (and its contents) recursively? I am aware of the chmod command but am not sure how would I specify a user...
Old 02-01-2005, 12:58 AM   #2
Registered: Dec 2004
Location: Espoo, Finland
Distribution: Gentoo, 2.6.16-gentoo-r11
Posts: 108

Rep: Reputation: 15

Chmod is only for changing the rights to the file. For changing owners you want to use the command chown. For recursive changing use the switch -R

# chown -R user:group direcory_to_be_changed

Old 02-01-2005, 07:13 AM   #3
LQ Guru
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
For future reference, "-R" is used by nearly all programs to specify a recursive action.


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
How to recursively rename files using their directory name pattern ceg4048 Linux - General 2 09-28-2005 01:16 PM
/dev entries changing their owner and permissions pulsosu Linux - Security 2 04-11-2005 06:19 PM
Protecting a directory with chmod, owner, groups, others clarence1720 Linux - Newbie 12 11-06-2004 01:33 AM
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
How to count line numbers recursively in a directory? puzz_1 Linux - General 1 07-01-2004 09:43 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:59 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
Open Source Consulting | Domain Registration