LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Other *NIX
User Name
Password
Other *NIX This forum is for the discussion of any UNIX platform that does not have its own forum. Examples would include HP-UX, IRIX, Darwin, Tru64 and OS X.

Notices


Reply
  Search this Thread
Old 12-05-2019, 07:43 AM   #1
newic
LQ Newbie
 
Registered: Dec 2019
Posts: 14

Rep: Reputation: Disabled
Question root


Hello,

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

this representation is less hierarcical, no ?
 
Old 12-05-2019, 07:50 AM   #2
sevendogsbsd
Senior Member
 
Registered: Sep 2017
Distribution: FreeBSD
Posts: 2,252

Rep: Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011
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.
 
Old 12-05-2019, 07:56 AM   #3
newic
LQ Newbie
 
Registered: Dec 2019
Posts: 14

Original Poster
Rep: Reputation: Disabled
yes this is the structure admise on all unix/linux. But could be proc/ tmp/ sys/ usr/ home/root/ home/user root/ (as /) ...
 
Old 12-05-2019, 08:00 AM   #4
newic
LQ Newbie
 
Registered: Dec 2019
Posts: 14

Original Poster
Rep: Reputation: Disabled
destitute root by moving / of the top
 
Old 12-05-2019, 08:02 AM   #5
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,879
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
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
 
Old 12-05-2019, 08:03 AM   #6
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,674

Rep: Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888
Quote:
Originally Posted by newic View Post
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.
 
1 members found this post helpful.
Old 12-05-2019, 08:03 AM   #7
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,779

Rep: Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304
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.
 
1 members found this post helpful.
Old 12-05-2019, 11:17 AM   #8
bodqhrohro
Member
 
Registered: Apr 2018
Location: Ukraine
Distribution: Debian GNU/Linux 12
Posts: 62

Rep: Reputation: Disabled
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.
 
Old 12-07-2019, 02:16 AM   #9
newic
LQ Newbie
 
Registered: Dec 2019
Posts: 14

Original Poster
Rep: Reputation: Disabled
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.
 
Old 12-07-2019, 08:19 AM   #10
bodqhrohro
Member
 
Registered: Apr 2018
Location: Ukraine
Distribution: Debian GNU/Linux 12
Posts: 62

Rep: Reputation: Disabled
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.
 
Old 12-07-2019, 08:56 AM   #11
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,473

Rep: Reputation: Disabled
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.
 
Old 12-07-2019, 07:41 PM   #12
agillator
Member
 
Registered: Aug 2016
Distribution: Mint 19.1
Posts: 419

Rep: Reputation: Disabled
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.
 
Old 02-13-2020, 11:52 PM   #13
champion_runner
LQ Newbie
 
Registered: Aug 2019
Location: India
Distribution: Ubuntu , Debian , Arch
Posts: 2

Rep: Reputation: Disabled
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.
 
Old 02-14-2020, 12:32 AM   #14
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,779

Rep: Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304
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
 
Old 02-14-2020, 09:58 AM   #15
bodqhrohro
Member
 
Registered: Apr 2018
Location: Ukraine
Distribution: Debian GNU/Linux 12
Posts: 62

Rep: Reputation: Disabled
Quote:
Originally Posted by champion_runner View Post
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.
 
  


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
how can i write to a root:root 750 file with a non-root user? Droa Linux - Newbie 1 05-14-2012 07:49 PM
root files: create as root:root or root:wheel? pcass Linux - Security 1 02-07-2004 04:14 PM
Changing root@localhost to root@domain.com Stingreen Linux - General 14 12-17-2002 06:21 PM
Why does kppp.desktop require root userid for non-root user? rdaves@earthlink.net Linux - Networking 4 08-27-2001 09:18 AM
DNS errors in email from root to root DavidPhillips Linux - General 1 06-24-2001 12:10 AM

LinuxQuestions.org > Forums > Other *NIX Forums > Other *NIX

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

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