LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 07-19-2010, 01:31 PM   #1
newbiesforever
Senior Member
 
Registered: Apr 2006
Location: Iowa
Distribution: Debian distro family
Posts: 2,375

Rep: Reputation: Disabled
how do I include subdirectories in a chown?


When I installed a new copy of my distro on another partition, in order to preserve all the settings from my old my user account, I made a user account with the same name on the new installation, and then copied my old user account's files (in their entirety) to the new user account, overwriting it. I did the copying from the root account (where else? I assume the new user account can't overwrite itself while it's open), and root became the owner of everything I copied, making it impossible to open the new user account. So I then chowned the new user account's folder to myself.

I still can't get in, because apparently, chown only chowned the top folder, leaving all subdirectories owned by root. How do I make chown include all subdirectories? I scanned the man page, but didn't see a parameter. Don't tell me I have to chown every folder and file one by one.
 
Old 07-19-2010, 01:34 PM   #2
brucehinrichs
Member
 
Registered: Mar 2008
Location: US
Distribution: Debian Sid; Sabayon, UbuntuStudio, Slackware-multilib 13.1, Peppermint Ice, CentOS
Posts: 575

Rep: Reputation: 69
Try
Code:
chown -R <username> <directoryname>
When in doubt, check the man page:
Code:
man chown

Last edited by brucehinrichs; 07-19-2010 at 01:35 PM. Reason: forgot username
 
Old 07-19-2010, 01:34 PM   #3
student04
Member
 
Registered: Jan 2004
Location: USA
Distribution: macOS, OpenBSD
Posts: 669

Rep: Reputation: 34
Code:
chown -R username:groupname dir
That should get all files, folders, etc. Be careful with permissions, though, they don't mean the same thing on files and directories ('x' and 'r').
 
Old 07-19-2010, 01:34 PM   #4
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,987

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
# chown -R <username>:<usergroup> /home/<username>
 
Old 07-20-2010, 09:45 AM   #5
sampuch
LQ Newbie
 
Registered: Jul 2010
Location: hyderabad
Distribution: rhel
Posts: 4

Rep: Reputation: 1
chown -R <username> directory
 
  


Reply



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
[SOLVED] Recursively include headers in include option for gcc kvm1983 Linux - Newbie 5 09-04-2012 03:21 PM
changing include directories - /usr/local/include quep_fly Linux - Newbie 6 08-12-2007 04:36 PM
how do I chown a PHP file on /usr/ to allow EVERYONE to include it? cpanelskindepot Programming 2 07-16-2004 03:36 PM
How to know the property a directory include the files and subdirectories? Xiangbuilder Linux - Newbie 3 08-31-2003 05:48 AM
appending PATH to automatically include subdirectories lyceum Linux - Newbie 2 08-20-2003 04:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:20 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