388-7 How to Read Synopses (Command Line)

Hello,

Can someone take me through a detailed answer for the questions? I am having a hard time understanding this.

You should pass to answer as many arguments as there are bullets. Each of the arguments should be yes if the command is legal, and no otherwise.

  1. id dq root Yes or no?
  2. whatis -rw python Yes or no?
  3. cd -Pe Yes or no?

Thank you,
Kris

I understand you are having a difficult time understanding the materials. However, I think it will be great if you can describe in detail what exactly you do not understand.

Updated: Legal command does not means the command can be executed or run. Legal means the command satisfy the program intended use that is described from the synopsis of the command manual.

However, you should attempt to execute each statement on the command line.

$> just to indicate the start of each command line in a terminal. It has nothing to do with any commands. Just to illustrate the start of each command blank line.

You can read more information about the command via the manual command.

id dq root

# To read the manual of id command
$> man id

I am using Mac OS X BSD terminal. Hence id command manual may differ from other flavors of linux/unix.

About id command

The id utility displays the user and group names and numeric IDs, of the calling process, to the standard output. If the real and effective IDs are different, both are displayed, otherwise only the real ID is displayed.

If a user (login name or user ID) is specified, the user and group IDs of that user are displayed. In this case, the real and effective IDs are assumed to be the same.

The usage of id described by the manual:

id [user]

where user are username of the system.

Assuming dq and root are user of the unix system. Then id dq root is a valid command. Short answer, yes.

cd -Pe

$> man cd

Reading the short option

-P use the physical directory structure without following
symbolic links: resolve symbolic links in DIR before
processing instances of `…’
-e if the -P option is supplied, and the current working
directory cannot be determined successfully, exit with
a non-zero status

Since -e short option requires the -P short option to be declared first, then by the order of the short option -Pe, P comes first before e. Therefore, the command is legal. Short answer, yes.

whatis -rw python

Intentionally leave out as an exercise for the original poster. Reading the documentation via the manual command is one way to solve the problem.

Updated: However, if you come across further queries, don’t hesitate to ask by commenting below.

1 Like

Thanks for your help. It made it much more clear.
Id dq root was actually not a valid command because there is an extra operand “root”. I was able to figure out looking back at your answer then the hints.

2 Likes

Hey @kris,

You are welcome.

We have a solved feature that allows you the ability to mark something as the “correct” answer, which helps future students with the same question quickly find the solution they’re looking for.

Here’s an article on how to mark posts as solved - I don’t want to do this for you until I know that solution/explanation works.

Best,
Alvin.