bad info on websites that does not work
From here wading thru the ways to do things, the only one that worked for me is
sudo chown -R $USER:$USER /path/to/dir https://askubuntu.com/questions/6723...-and-ownership While others were saying do this sudo chown -R username:group directory Anyway good luck trying to figure it out on your own, which many times you must. No explanation of what 'group directory' actually means. |
Uh...
It's just 2 different ways of saying the same thing. Presumably the posters think you know basic UNIX/Linux commands such as chown and are only telling you that you need to chown. You can type "man chown" to learn about this command. In both usages you list they are showing standard information: chown = The command to change owner (and/or group) of a file or directory. user = The user you want to be the owner of the file or directory. :group = The group you want put on the file or directory. The colon here is to show the user is on left and group on right. file = The file on which you are changing the owner and/or group In Linux a directory is a special type of "file". If you run "-R" with chown it says to do it recursively (i.e. not just the directory but all the other files in the directory including any subdirectories and files. The first usage is suggesting $USER for both "user" and "group". This implies you've set a variable called USER before that usage. It also assumes you have both a "user" and a "group" with the same name (or number [uid for user and gid for group]). They specify "/path/to/dir" to tell you that you need to figure out the full path of the directory (e.g. /var/www/billybob). In the second usage you're being told exactly the same thing. It is suggesting "username" for user and "group" for group and "directory" for directory. If you need help it is OK to ask for it but you don't have to imply others that have previously posted help somehow did YOU wrong because YOU don't understand. :tisk: |
'group' is the group you want the file or directory to belong to. 'directory' is the folder that you want to change permissions on
|
using it this way, what syntax to change from root ownership to user a folder and all subfolders and files?
'sudo chown -R username:group directory', likely does not work that way. I had to cut and paste from an old user account many files and pictures into my user account, and could only do it graphically by using 'sudo nemo', which then left all the copies owned by root. then this worked great here, as mentioned in another response on that page 'sudo chown -R $USER:$USER /path/to/dir' The other answers did not seem to fit the question. |
Quote:
as an example: Lets say the root user copied the Monthly_Reports directory into user benjamin's Documents directory and was still owned by root. To change it so that its owned by benjamin and the Users group do the following Code:
# chown -R benjamin:Users /home/benjamin/Documents/Monthly_Reports |
Quote:
|
You can see your groups like this:
Code:
erik@mycomputer:~$ id Just read MensaWaters' post. He already explained what I said.. Sorry for adding redundant info... |
Quote:
I came from the mainframe world, originally, Burroughs MCP OS; COBOL; LINC -- creating applications specific to the needs of my employer or customer (I actually wrote a General Ledger system once!). When I transitioned to Unix, the biggest challenge I faced was that I didn't know what I didn't know. That's generally true anytime we need or want to learn something new, but *nix can be particularly daunting for the newbie. First I learned about man pages. man chown will tell you everything you need to know about changing ownership on files [once you learn that "chown" is the command you need to learn about -- once you know what you don't know :)] Then I bought a half-dozen O'Reilly books and read them. Learning even more about what I didn't know. These days, one can get most (or maybe all) of the information that's in those books with a web search. Be patient with yourself. You'll get there. |
Quote:
Often it is a matter of knowing concepts that are appropriate to various systems then learning methods for the same concepts on other systems. DOS introduced me to command line. Novell introduced me to users and groups. UNIX/Linux introduced me to the world. Years ago I would connect different tables on Paradox (DB on DOS) easily but later on trying to figure out how to do the same kind of connection in Informix on UNIX I had a dickens of a time mainly because I didn't know this was called doing an "outer join". Solution was to scan through the entire Informix manual page by page until I got to one that seemed to be talking about what I wanted to do. Life is much easier now. You have man pages built into the systems for many things and for other things there is a plethora of help on the internet. Often you can simply type a keyword followed by "tutorial" to get nice startup guides. (e.g. "bash tutorial", "web tutorial", "awk tutorial"). In fact "chown tutorial" immediately pulls up among other things: https://www.howtoforge.com/linux-chown-command/ |
All times are GMT -5. The time now is 12:15 AM. |