Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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".
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.
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.)
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.