LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 07-02-2010, 03:08 PM   #1
Shay
Member
 
Registered: Sep 2003
Posts: 77

Rep: Reputation: 15
Change ownership of an entire directory.


Installed Sidux over Lenny

Sidux didn't want to take my usual username, because a folder with that name existed in my home directory.

So, I just mounted the home partition and changed the name of my home directory from shay to shay1.

Don't know what that did or didn't do permission wise to the files in my old home directory, but I've got a few unowned files floating around my home directory anyway that have been dragged in from old harddrives and such.

So, how do I "give" all of the files to user shay?
 
Old 07-02-2010, 03:20 PM   #2
nuwen52
Member
 
Registered: Feb 2009
Distribution: Debian, CentOS 5, Gentoo, FreeBSD, Fedora, Mint, Slackware64
Posts: 208

Rep: Reputation: 46
To change the ownerships of all files in a directory and it's subdirectories, do:
Code:
chown -R shay *
Now, if you want to change the group permissions at the same time to say, group users:
Code:
chown -R shay:users *
This will not to ".*" (dot files) in the same directory. Oh, you need to be root to do this, so either su to root, or run the chown in a sudo command.

Last edited by nuwen52; 07-02-2010 at 03:22 PM.
 
Old 07-02-2010, 03:36 PM   #3
Shay
Member
 
Registered: Sep 2003
Posts: 77

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by nuwen52 View Post
This will not to ".*" (dot files) in the same directory. Oh, you need to be root to do this, so either su to root, or run the chown in a sudo command.
Thanks. What if I do need to change ownership on dot files?
 
Old 07-02-2010, 09:03 PM   #4
AnanthaP
Member
 
Registered: Jul 2004
Location: Chennai, India
Posts: 952

Rep: Reputation: 217Reputation: 217Reputation: 217
dot files are not special types of files in linux. They are just hidden from `ls` without the -a option. Try `ls` and `ls -a` in a directory.

OK
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing ownership of an entire volume (Slack 12) LiquidCougar Linux - General 2 05-04-2008 09:28 AM
Creating script to change ownership directory on RHEL4U3 at startup Ferianto Linux - Enterprise 9 02-13-2008 10:01 PM
mount directory ownership shakezilla Slackware 3 01-23-2007 11:39 PM
ownership of directory lsu420luv Linux - General 1 06-09-2005 04:36 PM
change ownership Johng Linux - General 4 04-06-2004 02:24 AM

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

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