Bug 835211

Summary: which vs. whereis
Product: [Fedora] Fedora Reporter: Bill Nottingham <notting>
Component: util-linuxAssignee: Karel Zak <kzak>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 17CC: jonathan, kzak, mluscon, rvokal, than, tmraz
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-10-24 10:31:13 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Bill Nottingham 2012-06-25 19:29:17 UTC
Description of problem:

[notting@nostromo: ~]$ whereis bash
bash: /bin/bash /usr/bin/bash /usr/share/man/man1/bash.1.gz
[notting@nostromo: ~]$ /usr/bin/which bash
/usr/bin/bash

Ideally, they'd follow the same logic for finding the binary.

Version-Release number of selected component (if applicable):

util-linux-2.21.2-2.fc17.x86_64
which-2.20-3.fc17.x86_64

How reproducible:
100%

Comment 1 Tomas Mraz 2012-06-26 06:21:27 UTC
I think given the disclaimer in whereis manpage this is NOTABUG.

whereis has a hard-coded path, so may not always find what you're looking for.

Comment 2 Karel Zak 2012-06-26 07:11:14 UTC
(In reply to comment #1)
> whereis has a hard-coded path, so may not always find what you're looking
> for.

The note in the man page is obsolete (I'll fix it), the latest version also follows $PATH. Anyway, I think that whereis(1) should be smart enough to work with symlinks.

Comment 3 Karel Zak 2012-10-24 10:31:13 UTC
We're working upstream to improve the whereis(1) command.

Comment 4 Karel Zak 2013-03-21 07:38:20 UTC
Note that the problem is already fixed in upstream tree and the change will be available for F19/RHEL7.