LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 04-25-2016, 12:05 PM   #1
PleaseHelpMeUnderstand
Member
 
Registered: Apr 2016
Posts: 32

Rep: Reputation: 0
Changing Ownership


[root@serv01 sched] # ls -l
total 236
-rw-r--r-- 1 anniet sched 345 Apr 25 12:45 tues1
drwxr-xr-x 2 meganw sched 5678 Apr 25 12:45 wedn2
-rw-r--r-- 1 luciex sched 0 Apr 25 12:45 thur3

I want to change the owner of the tues1 file to meganw.

Is my command chown meganw tues1 sufficient for this? I was wondering if I had to add the group also so the command would be
chown meganw sched tues1 or is the group not needed since they're all in sched?

Last edited by PleaseHelpMeUnderstand; 04-25-2016 at 12:12 PM.
 
Old 04-25-2016, 12:15 PM   #2
cwizardone
LQ Veteran
 
Registered: Feb 2007
Distribution: Slackware64-current with "True Multilib" and KDE4Town.
Posts: 9,086

Rep: Reputation: 7262Reputation: 7262Reputation: 7262Reputation: 7262Reputation: 7262Reputation: 7262Reputation: 7262Reputation: 7262Reputation: 7262Reputation: 7262Reputation: 7262
man chown
 
Old 04-25-2016, 12:35 PM   #3
PleaseHelpMeUnderstand
Member
 
Registered: Apr 2016
Posts: 32

Original Poster
Rep: Reputation: 0
Still confused
 
Old 04-25-2016, 12:37 PM   #4
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
Try your command. Create a test file and run chown on it. See what happens.
 
Old 04-25-2016, 12:40 PM   #5
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by PleaseHelpMeUnderstand View Post
Code:
[root@serv01 sched] #   ls -l   
total 236 
-rw-r--r-- 1  anniet  sched 345 Apr 25 12:45  tues1 
drwxr-xr-x 2  meganw  sched 5678 Apr 25 12:45  wedn2
-rw-r--r-- 1  luciex  sched 0 Apr 25 12:45  thur3
Not to be rude, but which one of these are you? It's complete gibberish.
Maybe I just need coffee.

Last edited by Habitual; 04-25-2016 at 12:43 PM.
 
Old 04-25-2016, 12:49 PM   #6
PleaseHelpMeUnderstand
Member
 
Registered: Apr 2016
Posts: 32

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Habitual View Post
Not to be rude, but which one of these are you? It's complete gibberish.
Maybe I just need coffee.
Wow. Since you're not being rude or anything...None of them "are me".
Its the example from a practice lab that I was hung up on. I'm sorry I asked.

Last edited by PleaseHelpMeUnderstand; 04-25-2016 at 01:04 PM.
 
Old 04-25-2016, 01:08 PM   #7
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
What keeps you from practicing the command? You can speed up your learning curve considerably with some initiative.
 
1 members found this post helpful.
Old 04-25-2016, 01:29 PM   #8
PleaseHelpMeUnderstand
Member
 
Registered: Apr 2016
Posts: 32

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Emerson View Post
What keeps you from practicing the command? You can speed up your learning curve considerably with some initiative.
Thank you for your encouragement. I am practicing. For this example it's not in the virtual system I am working in. It's a practice lab that someone gave me to answer on paper. I tried to create the same setup but I received an error message that "Operation not permitted".
 
Old 04-25-2016, 01:36 PM   #9
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
Run groups command. Now you know what groups you belong to. Next run touch testfile, this will create testfile. Next do ls -l testfile, you will see the permissions and ownership. Now try chown on it, use groups you are member of.
 
1 members found this post helpful.
Old 04-25-2016, 01:44 PM   #10
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,780

Rep: Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198
According to the man page you can add a :group, i.e. chown newowner:newgroup ... instead of just chown newowner ...
But as you said, it is not needed because you do not change the group.
And, as somebody else said, there is no risk here; you can simply run it.
(But there is a risk if the root user blindly runs a chown -R ... , because it follows symbolic links.)
 
1 members found this post helpful.
Old 04-25-2016, 02:45 PM   #11
PleaseHelpMeUnderstand
Member
 
Registered: Apr 2016
Posts: 32

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Emerson View Post
Run groups command. Now you know what groups you belong to. Next run touch testfile, this will create testfile. Next do ls -l testfile, you will see the permissions and ownership. Now try chown on it, use groups you are member of.
Thank you for your explanation.

I had to add myself to more than one group since I was only apart of 1 group when I ran the groups command. However when I tried to add to other groups and run the groups command again, it's only displaying that original group. I went back to Users and Groups and its displaying that I'm in 5 groups but in my terminal the groups command isn't displaying that.

I did everything else you said to do too, and I now understand where you are going with this but I still would like to do the chown to change it but still when I run the groups command, only 1 group displays which is odd to me why this is happening

Last edited by PleaseHelpMeUnderstand; 04-25-2016 at 02:48 PM.
 
Old 04-25-2016, 03:00 PM   #12
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
You need to log off and back in for changes to go in effect.
 
1 members found this post helpful.
  


Reply


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
Changing ownership cryste Linux - Newbie 5 06-17-2011 11:28 AM
Changing group ownership rayn0r Linux - Networking 1 11-28-2007 04:35 PM
Changing ownership of vfat mount maamold Linux - Software 2 02-25-2005 02:27 AM
changing the ownership djh Slackware 3 11-08-2004 04:16 AM
Changing ownership of folders Nurfen Linux - Newbie 1 08-01-2004 12:00 PM

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

All times are GMT -5. The time now is 02:46 PM.

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