Visit Our UNIX and Linux User Community


whereis ls


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers whereis ls
# 1  
Old 11-09-2001
whereis ls

When I execute the following:

Code:
<pre>

$ whereis ls
ls: /usr/bin/ls /usr/ucb/ls
$ pwd
/bin
$ ls -la ls
-r-xr-xr-x   1 bin      bin        18120 Oct  6  1998 ls

</pre>

....but as you can see the 'ls' command is in the /bin directory AS WELL. Why doesn't show up on 'whereis'???

Thanks
# 2  
Old 11-09-2001
I think that /bin would need to be in your PATH for the whereis to find it. If you add /bin to your PATH->

export PATH=$PATH:/bin:

and try your whereis again, maybe it will be found.
# 3  
Old 11-09-2001
Does this work with you?? Because the /bin seems to be appearing in the PATH

Code:
<pre>

isgsi01(root)7: echo $PATH
/usr/openwin/bin:/usr/openwin/bin/xview:/usr/bin/X11:/usr/bin:/usr/ucb:<B>/bin<B>:/usr/sbin:/etc:/usr/etc:/usr/sccs:/usr/ccs/bin:/usr/opt/SUNWmd/sbin:/opt/SUNWhsm/sbin:/jumpstart/admin/bin:.

isgsi01(root)9: whereis ls
ls: /usr/bin/ls /usr/ucb/ls
isgsi01(root)10: 


</pre>

but still does not show up using 'whereis'
# 4  
Old 11-11-2001
The whereis command does not use the PATH env var for the search path. It uses a pre-defined search path, see the man page for whereis. Try the which command to search along your PATH.
 

Previous Thread | Next Thread
Test Your Knowledge in Computers #763
Difficulty: Medium
L4 caches are currently very common in computer systems.
True or False?

2 More Discussions You Might Find Interesting

1. Homework & Coursework Questions

Help with find/whereis C Shell Script

Use and complete the template provided. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Write a C Shell Script called "hunt" that takes a filename as it's single parameter and displays the full pathname of every file name that matches,... (1 Reply)
Discussion started by: new2C
1 Replies

2. UNIX for Dummies Questions & Answers

difference of find,locate and whereis

hi guys, may i know the difference of find,locate and whereis ? (3 Replies)
Discussion started by: cromohawk
3 Replies

Featured Tech Videos