LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   weird chown option that's only available in man page.. what on earth is chown root /u ? is /u is an option/ flag to chown command? (https://www.linuxquestions.org/questions/linux-newbie-8/weird-chown-option-thats-only-available-in-man-page-what-on-earth-is-chown-root-u-is-u-is-an-option-flag-to-chown-command-4175705505/)

andrewysk 12-28-2021 06:53 AM

weird chown option that's only available in man page.. what on earth is chown root /u ? is /u is an option/ flag to chown command?
 
I came across chown cli option from man page: "chown root /u" . I can't understand the explaination and can't find any related info in internet.

According to my search so far, i can't locate any chown command come with "/u" option.. What on earth is that ?

Code:


man chown

EXAMPLES
      chown root /u
              Change the owner of /u to "root".

      chown root:staff /u
              Likewise, but also change its group to "staff".


pan64 12-28-2021 06:56 AM

/u is not an option but an [example] directory or file to work on.

jmgibson1981 12-28-2021 08:52 AM

One thing I know for certain is that many man pages aren't exactly understandable to most people. Is one of the frustrations many have, myself included when were are told "go read the man pages". That being said in this case I'm amazed they didn't put something like chown root /path or something. U is kind of random out of nowhere. If you are already familiar with the command line then you understand it immediately. But to a person who is just learning it doesn't make much sense, especially if they come from a Windows background where cmd options are passed that way.

teckk 12-28-2021 08:57 AM

Look at:
Code:

chown --help
man chown
apropos chown
info chown


teckk 12-28-2021 09:03 AM

And if it helps you:

Code:

man -t chown | ps2pdf - chown1.pdf

man chown | roff2pdf > chown2.pdf

man -P cat chown > chown1.txt

man chown | roff2text > chown2.txt

man chown | col -b > chown3.txt

man -t chown | ps2ascii - chown4.txt

man chown | roff2html > chown1.html

man chown | groff -mandoc -Thtml > chown2.html

man -Hfirefox chown

man -Hdillo chown


hazel 12-28-2021 10:05 AM

https://www.linuxquestions.org/quest...n-pages-38130/

andrewysk 12-28-2021 10:06 AM

:eek: what are these ?:eek: lol You just gave me more HOMEWORK to do.. it is a link to chain linked to another.. That's why it takes a lot of time for me to learn something.. because from trying to install slax iso onto usb, i have to learn how to convert 9660iso into hybrid iso, and to learn to convert, i want to understand loop device... and from there i landed on chown.. .and from chown /u i am diverted to roff2text and ps2pdf all these things (that i have never heard before).. .. no end.. rabbit hole.. lol .. but thanks for letting me know there is such cli on my system...

Quote:

Originally Posted by teckk (Post 6312932)
And if it helps you:

Code:

man -t chown | ps2pdf - chown1.pdf

man chown | roff2pdf > chown2.pdf

man -P cat chown > chown1.txt

man chown | roff2text > chown2.txt

man chown | col -b > chown3.txt

man -t chown | ps2ascii - chown4.txt

man chown | roff2html > chown1.html

man chown | groff -mandoc -Thtml > chown2.html

man -Hfirefox chown

man -Hdillo chown



andrewysk 12-28-2021 10:09 AM

Quote:

Originally Posted by jmgibson1981 (Post 6312927)
One thing I know for certain is that many man pages aren't exactly understandable to most people. Is one of the frustrations many have, myself included when were are told "go read the man pages". That being said in this case I'm amazed they didn't put something like chown root /path or something. U is kind of random out of nowhere. If you are already familiar with the command line then you understand it immediately. But to a person who is just learning it doesn't make much sense, especially if they come from a Windows background where cmd options are passed that way.

Who would have know /u is refering to a directory ? why /u ? usually a directory should be <directory>

hazel 12-28-2021 10:12 AM

Quote:

Originally Posted by andrewysk (Post 6312939)
i want to understand loop device... and from there i landed on chown.. .and from chown /u i am diverted to roff2text and ps2pdf all these things (that i have never heard before).. .. no end.. rabbit hole.. lol ..

Welcome to Linux documentation! We've all been there. You start with one thing and before you know it, you're leafing through man pages without end.:study:

pan64 12-28-2021 10:14 AM

Quote:

Originally Posted by andrewysk (Post 6312941)
Who would have know /u is refering to a directory ? why /u ? usually a directory should be <directory>

That is "obvious" if you are familiar with that chown tool. That is not an option, because those are always started with a - and not the permission itself, so it can be only the last argument, which is a FILE (see man page).

andrewysk 12-28-2021 11:14 AM

Quote:

Originally Posted by hazel (Post 6312938)

Hii hazel
I have read thru your how to read man page article..

I must admit, it is very infomatic.. but for certain part that i don't understand; it is hard for me to imagine what you said.. If you include some photo or example, it would be much easier for people like me who rather learn by example.

Anyway, Thanks for your effort.

scasey 12-28-2021 04:14 PM

One of the first things one needs to learn how to do in any new environment is how to read the documentation. Since I started coding back in the 70s I’ve had to learn at least eight or nine documentation systems (anyone remember Burroughs railroad diagrams…in 3-ring binders?)
As has been said, *nix man pages are one of the most challenging, probably because they are written by several (thousands?) different people/groups. hazel’s guide is excellent!

pan64 12-31-2021 08:16 AM

Quote:

Originally Posted by andrewysk (Post 6312968)
Hii hazel
I have read thru your how to read man page article..

I must admit, it is very infomatic.. but certain part that i don't understand; it is hard for me to imagine what you said.. If you include some photo or example, it would be much easier for people like me who rather learn by example.

Anyway, Thanks for your effort.

Your question is unclear. What part is what you don't understand?


This was an example (man chown). There is no common and general way. As it was written:
Quote:

As has been said, *nix man pages are one of the most challenging, probably because they are written by several (thousands?) different people/groups.
Probably the best was to ask here.

andrewysk 12-31-2021 05:35 PM

Quote:

Originally Posted by pan64 (Post 6313604)
Your question is unclear. What part is what you don't understand?

I was refering to this.. it said the man page is organized as such.. especially "devices, File formats, Miscellaneous, System administration. " I have no idea where are these located... hence i said if got simple diagram ... or example, it would clear up my mind.. but i guess not important, because i usually don't use these portions of man.

Code:

How man pages are organised
There are eight sections in the manual. The division is not by subject but by the type of entity being described:

    User commands. These are commands that anyone might use to get work done. Graphical as well as cli commands are included.
    System calls. These are C functions that are of interest to programmers but not ordinary users. They allow programs to invoke the help of the kernel for a variety of tasks such as hardware access or file access.
    C library subroutines. Again, these are of interest to programmers only. All Linux programs use the C library (glibc) and therefore use these functions. Some of them are more programmer-friendly wrappers for system calls. Others deal with tasks like arithmetic and string processing.
    Devices. Devices are defined as anything that the kernel can read from or write to. Some of the best known ones are described here.
    File formats. Here you will find recipes for all the most important system files in Linux. These files mostly reside in the /etc directory and are editable by the root user. It is good practice to check for a man page and read it before carrying out an edit.
    Games. Not a large section!
    Miscellaneous. If it doesn't fit in anywhere else, it goes here.
    System administration. Commands that are usually used by system administrators, and most of them require root access to work.


computersavvy 12-31-2021 05:55 PM

Many of the man pages give examples on how to use the command. Most expect the user to have a basic understanding of the command line and how to read the usage part at the top (the synopsis).

For example, with chown I see this.
Code:

NAME
      chown - change file owner and group

SYNOPSIS
      chown [OPTION]... [OWNER][:[GROUP]] FILE...
      chown [OPTION]... --reference=RFILE FILE...

This tells me the command (chown) is followed by options (given below) then the owner or owner:group to assign, then the file (one or more) that is to be acted upon.
Thus the example "chown root /u" is really easy to understand. In english it means change ownership of /u to the user root.

Almost all basic commands are command --> option --> file and if you can remember that you will not be caught by surprise by the examples. Also, remember that examples are examples and not to be taken literally.


All times are GMT -5. The time now is 12:36 AM.