Well, going up to the topic title you get "104.7 Find system files and
place files in the correct location", so finding files is definitely
part of the topic. Both which and type are capable of telling you which
file (including path) would be executed for a command. Indeed, the man
page for which says:
Which takes one or more arguments. For each of its arguments it prints
to stdout the full path of the executables that would have been exe‐
cuted when this argument had been entered at the shell prompt.
That, of course, is for /bin/which, but systems often alias which, for
example:
$ type which
which is aliased to `alias | /usr/bin/which --tty-only --read-alias
--show-dot --show-tilde'
In this case which behaves somewhat more like type in that it considers
aliases (but not functions), but the real which in /bin/which is
designed to tell you where a command will be run from.
You could certainly make a case for not including which and type in
104.7, but you could probably equally make a case for changing the
objective description so they belong more clearly.
Ian Shields
On 7/30/2015 14:02, Simone Piccardi wrote:
> Il 30/07/2015 14:14, Ian Shields ha scritto:
>> I think which and type are included in 104.7 because the objective
>> includes "Find files and commands on a Linux system". It's not just
>> about FHS. I also discuss both in my 103.1 and my 104.7 articles on IBM
>> developerWorks.
>>
> Sorry but I don't think type is about finding a command, at least not in
> the meaning specified by the topic description:
>
> "Candidates should be thoroughly familiar with the Filesystem Hierarchy
> Standard (FHS), including typical file locations and directory
> classifications."
>
> Even if it can tell you the executable path that will exec'd when the
> first word you are writing on a command line correspond to a file name
> in a directory listed in the shell PATH, this has almost nothing to do
> with knowing about /bin vs /sbin vs /usr/bin, etc. that's the topic subject.
>
> The command is used to show how the shell will interpret what you write
> as "command", if it will taken as an internal command, as an alias or as
> function (and you will find nothing here). Or as a file to be exec'd.
>
> I found confusing also putting "which" in this topic, they are shell
> internal command to show which will be the shell behaviour, not to look
> at where executable are put inside the filesystem.
>
> Simone
_______________________________________________
lpi-examdev mailing list
[email protected]
http://list.lpi.org/cgi-bin/mailman/listinfo/lpi-examdev