LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Other *NIX (https://www.linuxquestions.org/questions/other-%2Anix-55/)
-   -   root (https://www.linuxquestions.org/questions/other-%2Anix-55/root-4175665449/)

newic 12-05-2019 07:43 AM

root
 
Hello,

why / is root and not root is /root/ as all classic's Unix path

this representation is less hierarcical, no ?

sevendogsbsd 12-05-2019 07:50 AM

Not sure what you mean. The root user's home directory is always "/root". I have heard the term "root directory" or "root of the drive" which meant "/" but that's just a term.

newic 12-05-2019 07:56 AM

yes this is the structure admise on all unix/linux. But could be proc/ tmp/ sys/ usr/ home/root/ home/user root/ (as /) ...

newic 12-05-2019 08:00 AM

destitute root by moving / of the top

rtmistler 12-05-2019 08:02 AM

I feel the followup helps no better in clarifying the question.

Well, the formal documentation for the Linux file system is here: https://www.tldp.org/LDP/Linux-Files...tml/index.html

ehartman 12-05-2019 08:03 AM

Quote:

Originally Posted by newic (Post 6064905)
why / is root and not root is /root/ as all classic's Unix path

/ is a directory and the root of the "root" file system. It normally should not contain any "normal" files, just subdirectories. It is the highest directory in the whole tree.
The / dir of other filesystems becomes associated with its mount dir within the root fs.

root is the USER name (with ID 0) which owns that directory (and most of the system below it, like /etc /usr /*bin and /lib*). To keep that user's HOME directory from residing in a mountable fs the convention has become to put those (profile) files into a /root subdir ON the root fs.
This hasn't always been so and it IS just a convention.

pan64 12-05-2019 08:03 AM

can you explain it a bit better? I do not really understand what do you mean?
The home dir of root is /root, not /home/root, because usually /home is mounted, but the home dir of root should be available without mounting anything. I do not know how is it related to proc, tmp, sys or other dirs.

bodqhrohro 12-05-2019 11:17 AM

Why would you need /root/ as a root for all paths? It would simply be expensive, especially if taking into account the 255 symbols limit for path length. As you can ntc, othr dir nms r prtty concs as wl.

newic 12-07-2019 02:16 AM

To simplify administration (defaults permissions simplified) and justify that "all is file in Unix" : / cannot represent a file because He is top, /root talking himself, mkdir / is just impossible, mkdir /root is.

Quote:

The home dir of root is /root, not /home/root,
I imagine that could be changing and could be to be a type of deviant system with an alternate security system.

bodqhrohro 12-07-2019 08:19 AM

You can set permissions on / as well. And if you make the root a file, what will be the top directory then? should other files become rootless, like CON/AUX/COM* in DOS/Windows? Top and root are actually synonymous, I don't get why do you try to distinguish them. Even the probably purest UNIX-like system, Plan 9, does have / as a root directory, and does not drop the concept of directories.

fatmac 12-07-2019 08:56 AM

Let me try, the symbol / is the base of your operating system. the usual O/S contains first level main directories, /bin /sbin /etc /var, needed to have an actual system to work, in these are all the absolute necessary parts of an O/S, these are used by the admin user, root.
Then we have the secondary level of directories, /usr/bin /usr/sbin /opt, etc, which can be used by a user, as well as the root user.
You can operate a system without the secondary level directories, but not without the first level directories.
This, of course, is a simplification of the hierarchy in use.

agillator 12-07-2019 07:41 PM

Others have explained and I won't say anything materially different, just use different words and maybe that will help you.

To Linux, everything is a file, period. Files are 'placed' somewhere. These are called directories. The directories, together, are organized as a tree; actually as an upside down tree. Following the tree analogy the starting point for the directory tree is called the root. It is given the symbol (and recognized by the system) /. This is simply the starting point of the tree. To tell the system where to find a file (the path) you always have to tell it the starting point and then the series of branches, or directories, to traverse to find the file. That starting point is always either / (the root) or the current directory. A path of /x/y/z starts at the root, looks in directory x for directory y, in directory y for directory or file z. A path of x/y/z starts not at the root but in the current directory, and then on as before, x being in the current directory.

Every user on the system has a home directory for their personal stuff that other users are normally limited in their access to. Root is a user just with super powers. But like all users root has a home directory. The standard for Linux is for all normal users' home directories to be in the 'home' directory which is a subdirectory of / (which has nothing to do with the user root). However, because the user root is special and should be kept separate s/he is given a special directory called 'root', a subdirectory of / but performing the same functions, though with special powers and permissions as other home directories.

Another way of looking at it is that / belongs to the system, not any individual. /root belongs to a super user called root and other users have very limited, if any, access to that user's directory. The fact that the term root is used in two different ways is unfortunate, perhaps, but that is the English language for you.

Again, follow the tree analogy: / is the root, base, origin of the tree; /root is a branch off that base or origin.

champion_runner 02-13-2020 11:52 PM

I have an issue regarding the superuser.
Is there a way to provide a direct grant to root as superuser other than just go to sudo su again and again? Since in my new project the folder has some kind of lock I am facing and hence I am not able to delete any files internally.

pan64 02-14-2020 12:32 AM

would be nice to open a new thread instead of hiding another (and different) one.
Also would be nice to explain exactly what did you try and what happened.
Theoretically root has right to do anything, there is no way to grant more

bodqhrohro 02-14-2020 09:58 AM

Quote:

Originally Posted by champion_runner (Post 6089820)
Since in my new project the folder has some kind of lock I am facing and hence I am not able to delete any files internally.

You probably have an issue with permissions. Run ls -la /Your/Project/Directory/ and you'll see if the directory itself or some files don't have write permissions or are owned by some other user. You then can fix this chmod, chown or chgrp utilities respectively.


All times are GMT -5. The time now is 03:02 AM.