LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-22-2018, 03:14 AM   #1
YorkshireSam
LQ Newbie
 
Registered: Sep 2018
Location: Crook Durham England
Distribution: Mint Debian
Posts: 3

Rep: Reputation: Disabled
Puzzled by terminology


During my 'studies' I have been using many man pages and am often left puzzled by some of the terminology used. In particular while studying user administration I have been investigating the id command.
There are two options used with this command that return a rather obscure message. The id -n and id -r both return the message that 'it cannot print only names or real id's in default format' For the life of me I cannot fathom out exactly what this actually means. Can anyone shed any light or am I being particularly dense?
 
Old 09-22-2018, 03:23 AM   #2
Michael Uplawski
Senior Member
 
Registered: Dec 2015
Posts: 1,623
Blog Entries: 40

Rep: Reputation: Disabled
Quote:
Originally Posted by YorkshireSam View Post
The id -n and id -r both return the message that 'it cannot print only names or real id's in default format'
Hit, sunk!
You found a documentation bug.

On the other hand, if you look in the man-page, you see three possible options in parenthesis. What you need to know (but nobody is obliged to), is that "with" means in reality: “This option only works with one of the following three, never more than one of them, though”.
Like in:
  • id -n -u
  • id -n -g
  • id -n -G

But have mercy with the authors. The necessity to reformulate, often arises only after a few people have complained. Many do never complain, though. And my own wisdom I got from consulting the German version of the man-page, which can (or not) hint at an improvement during translation...

One of the best bosses in the world (I was a lucky guy) insisted on a very verbose documentation style and on the expression also of all “implicitly clear” facts, as they never are to everybody.

But software developers are sometimes proud of the confusion they create. And some people are proud of the confusion they create, without even being software developers.

... I say: Keep Them Coming! Someone will straighten that out, if we make enough noise.

Last edited by Michael Uplawski; 09-22-2018 at 03:30 AM. Reason: ... this topic always makes me tremble with anger.
 
1 members found this post helpful.
Old 09-22-2018, 03:29 AM   #3
aragorn2101
Member
 
Registered: Dec 2012
Location: Mauritius
Distribution: Slackware
Posts: 567

Rep: Reputation: 301Reputation: 301Reputation: 301Reputation: 301
Hi, and welcome to LQ,

For the "-n" and the "-r" options, we see from the man pages:

Code:
       -n, --name
              print a name instead of a number, for -ugG

       -r, --real
              print the real ID instead of the effective ID, with -ugG
Actually, we are being instructed that -n and -r options are not to be used alone but together with -u, -g or -G. So, below is an example:
Code:
user1@desktop:~$ id -n
id: cannot print only names or real IDs in default format
user1@desktop:~$ id -r
id: cannot print only names or real IDs in default format
user1@desktop:~$ id -u
1000
user1@desktop:~$ id -n -u
user1
user1@desktop:~$ id -g
1000
user1@desktop:~$ id -n -g
user1
user1@desktop:~$ id -r -g
1000
user1@desktop:~$ id -G
1000 11 17 18 19 20 80 90 100
user1@desktop:~$ id -n -G
user1 floppy audio video cdrom games apache pop users
user1@desktop:~$ id -r -G
1000 11 17 18 19 20 80 90 100
 
1 members found this post helpful.
Old 09-22-2018, 03:38 AM   #4
Michael Uplawski
Senior Member
 
Registered: Dec 2015
Posts: 1,623
Blog Entries: 40

Rep: Reputation: Disabled
Quote:
Originally Posted by aragorn2101 View Post
Actually, we are being instructed
You are of course right, in a way.
But the word “to instruct” might need a new definition. Meriam-Webster:
Quote:
1 : to give knowledge to : teach, train

2 : to provide with authoritative information or advice the judge instructed the jury

3 : to give an order or command to : direct
From the man-page:
Quote:
with
 
Old 09-22-2018, 06:36 AM   #5
YorkshireSam
LQ Newbie
 
Registered: Sep 2018
Location: Crook Durham England
Distribution: Mint Debian
Posts: 3

Original Poster
Rep: Reputation: Disabled
Lightbulb

Thank you Aragorn
Now you have pointed it out... its bl..... obvious.. Thank you.
Actually, we are being instructed that -n and -r options are not to be used alone but together with -u, -g or -G. So, below is an example:
 
Old 09-24-2018, 12:50 PM   #6
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by YorkshireSam View Post
Thank you Aragorn
Now you have pointed it out... its bl..... obvious.. Thank you.
Actually, we are being instructed that -n and -r options are not to be used alone but together with -u, -g or -G. So, below is an example:
Not necessarily true for all CMDs/utilities!

-x is the "short option" or switch and
--x would be the "long option" or switch.

take
Code:
ls -al
as an example,
The long options are better at conveying intent, thus you don't need to consult the man page when you read
Code:
ls --almost-all --dereference
says this.
I believe people got tired of the long option switches back the olden days and asked devs for short ones.
Not all long options have short options. So As usual
Code:
man <utility>
is the place to look.

On my mac, there is no short "-r" for the id command.

Sometime they just aren't documented correctly.
I think that's why we're supposed to "check" /usr/local/share/doc/<utility>
under such conditions.

Have fun.
 
  


Reply



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
Puzzled BasieBop Linux - General 12 03-11-2017 10:13 AM
puzzled beckwith Linux - Software 11 02-26-2015 01:35 AM
I am puzzled...help! yaximik Linux - Newbie 10 07-03-2011 07:08 PM
need help on puzzled sir_com Linux - General 1 06-06-2008 12:03 AM
puzzled... earlysame55 Linux - Newbie 2 04-13-2008 03:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:44 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