You are not logged in.
the general question is, how can I set the permissions and ownership of files/folders en masse through the terminal?
I've been wandering around the net and I can't seem to find an answer at the moment...
Running with ICEwm and Cinnamon DE.
I've got my profile set as root, wheel, and users.
Edit: My apologies to the administration for ignoring forum etiguette.
Last edited by Vi (2014-02-18 00:06:31)
Offline
I'm inclined to think you will make a massive mistake, but here you go
man chmod
Offline
What exactly do you want to do?
Both chmod and chown have a flag for recursion.
Xyne has a service in his repository to watch folders and adjust the permission of the files and folders in it: http://xyne.archlinux.ca/projects/autochown/
Offline
I'm inclined to think you will make a massive mistake, but here you go
I'm not that clumsy thank you, I did fry my jumpdrive... but that was in the process of learning.
I just did a more vague search in the wiki for what I was looking for and it came up with 'chmod' as well.
@mychris - I screwed up on my file back up and all my files are owned by root.
Root is to stay root, so that I don't inadverdently destroy my system.
Offline
Please edit your first post and use a title that accurately reflects your question: the current one will just pollute search results:
https://wiki.archlinux.org/index.php/Fo … ow_to_Post
Offline
@mychris - I screwed up on my file back up and all my files are owned by root.
If all the files are in one directory and should be owned by one user you can use the recursive flags.
You can also use find with the exec flag to change permission/ownership.
Offline
If all the files are in one directory and should be owned by one user you can use the recursive flags.
You can also use find with the exec flag to change permission/ownership.
They are all in one directory yes.
I shall be doing that once I finish my reading, been raised on doing almost everything through the GUI. Archlinux is a big jump, so I'll be moving slowly to avoid any big mistakes if I can help it.
Edit: Trains of thought wandered.
Last edited by Vi (2014-02-17 23:25:00)
Offline
I'm inclined to think you will make a massive mistake, but here you go
I second that. You may also want to investigate the find command and its -exec command.
It is a power tool. One should be very careful with power tools.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
eh, if I screw up that's fine, I'm still learning how to properly work linux without a gui.
I'd really rather not screwup, but if it happens I'll just have to learn to fix the problem.
Offline
Read the man page, understand the program and try it out. Especially with find and the exec flag, you can first execute find without the exec flag and see what files/folders your conditions meet and then execute it with the exec flag and actually do something.
If your permissions/owners are already screwed up, how can you screw up more? if everything is owned by root and you know the root pw, have sudo, ...., the worst thing which could happen is that it is no longer owned by root, but you can change it again
(execute the same find again, but change the -exec chown and point it to root...)
(execute the same recursive chown again, but change the owner...)
(...)
Last edited by mychris (2014-02-18 00:04:55)
Offline
Read the man page, understand the program and try it out. Especially with find and the exec flag, you can first execute find without the exec flag and see what files/folders your conditions meet and then execute it with the exec flag and actually do something.
Sage advice, spent some time reading the man page of both chmod as well as chown.
Kept them both open while running both as root so that I could refer to them during the process.
If your permissions/owners are already screwed up, how can you screw up more? if everything is owned by root and you know the root pw, have sudo, ...., the worst thing which could happen is that it is no longer owned by root, but you can change it again
A few files were owner by root that shouldn't have, but using:
chown username [file path / directory / file name* and extension**]
*only if you're in the directory the file is located in.
**if applicable.
While root fixed that problem.
Thank you for the help ladies and gentlemen, I apologize if irked your ire with this question.
Offline