whereis & which & type Flashcards
1
Q
whereis
A
whereis locates the binary, source and manual files for the specified command names.
2
Q
whereis
- b, search only for binaries
- B <dirs>, define binaries lookup path</dirs>
- m, search only for manuals and infos
- M <dirs>, define manual and infos lookup path</dirs>
- s, search only for sources
- S <dirs>, define sources lookup path</dirs>
A
- f, terminate <dirs> argument list</dirs>
- u, search for unusual entries
- l, output effective lookup paths
3
Q
which
A
which returns the pathnames of the files (or links) which would be executed in the current environment, had its arguments been given as commands in a strictly POSIX-conformant shell.
4
Q
which -a filename
A
-a, print all matching pathnames of each argument.
5
Q
type
A
Display information about command type. For each NAME, indicate how it would be interpreted if used as a command name.
6
Q
type
- a
- f
- P
- p
- t
A
- a, Display all locations containing an executable named NAME.
- f, Suppress shell function lookup.
- P, Force a PATH search for each NAME.
- p, Returns either the name of the disk file that would be executed, or nothing if type -t NAME would not return ‘file’
- t, Output a single word which is one of: alias, keyword, function, builtin, file, or ‘’ for NAME.