- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- silly question about "which"
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2003 03:28 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2003 03:30 PM
01-30-2003 03:30 PM
Re: silly question about "which"
if I su to a user "a"
, I got this error message
cannot open ..
...even if i am in the directory to find the file,
which command won't work...
why ?? can some1 help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2003 03:33 PM
01-30-2003 03:33 PM
Re: silly question about "which"
Do you have correct permissions on /usr/bin/which file?.
-r-xr-xr-x 1 bin bin 661 Nov 7 1997 /usr/bin/which
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2003 03:35 PM
01-30-2003 03:35 PM
Re: silly question about "which"
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2003 03:53 PM
01-30-2003 03:53 PM
Re: silly question about "which"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2003 03:58 PM
01-30-2003 03:58 PM
Re: silly question about "which"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2003 03:59 PM
01-30-2003 03:59 PM
Re: silly question about "which"
Since which noses around different folders looking for your request and "." is searched too. Then you could get that error message if you didn't have access.
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2003 04:09 PM
01-30-2003 04:09 PM
Re: silly question about "which"
whereis which
If paths are correctly set up for user 'a', 'whereis' should be able to find 'which'.
Aside from the fact that you are having an actual problem, I can't help being amused at having a discussion about which, whereis, why it doesn't work, what caused it, etc. Sorry, warped mind, probably computer-related.
Good Luck! --bmr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2003 04:11 PM
01-30-2003 04:11 PM
Re: silly question about "which"
user1> which /usr/bin/junk
/usr/bin/junk not found
This simply means you are not able to access the file or the file is not there. How about simple "ll" on the file?.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2003 04:13 PM
01-30-2003 04:13 PM
Re: silly question about "which"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2003 06:27 AM
01-31-2003 06:27 AM
Re: silly question about "which"
I think the "su - a" has nothing to do with it, but just with the fact that you are not root.
A small example:
$ ll -d .
drwxr-xr-x 15 franks ftp_group 17408 Jan 31 14:16 .
$ cd temp
$ which ksh
/usr/bin/ksh
$ chmod 000 ..
$ ll -d ..
d--------- 15 franks ftp_group 17408 Jan 31 14:16 ..
$ which ksh
cannot open ..
$ chmod 500 ..
$ ll -d ..
dr-x------ 15 franks ftp_group 17408 Jan 31 14:16 ..
$ which ksh
/usr/bin/ksh
$
So which(1) needs read (r) and execute (x) permission on the parent (..) directory.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2003 07:04 AM
01-31-2003 07:04 AM
SolutionBasic UX issue, though Linux seems to have gotten around it.
In order to browse the contents of a directory, it must have execute permissions. It's always seemed counter intuitive to me.
As you tighten security, you may find the which command is less useful.
You can always cd to the directory of the program and which ./progname
It does limit functionality though.
P
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2003 08:33 AM
01-31-2003 08:33 AM
Re: silly question about "which"
/it , when do ll -d , if the .. (parent directory) wasn't there, what might be the cause
for this? Perhaps permission has changed???
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2003 09:01 AM
01-31-2003 09:01 AM
Re: silly question about "which"
> the .. (parent directory) wasn't there, what might be
> the cause for this? Perhaps permission has changed???
Please be careful when spelling commands. Preferably put them on seperate lines.
To answer your question. If you do
mkdir /it
and then do
ll -d
then the ll(1) command will only list the current directory (.), not the parent directory (..), so what (I think) you are seeing, is normal.
If you want to see the parent directory (..) in the listing, then you can for example use
ll -a
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2003 09:16 AM
01-31-2003 09:16 AM
Re: silly question about "which"
base on your sample, i am still unable to create the error message....
p.s this problem was solved by
some1 rebuild the f/s and mount them back again...however, i don't think there is the problem with logical volume...
I am still very intersted on creating this problem again....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2003 09:43 AM
01-31-2003 09:43 AM
Re: silly question about "which"
it indicates ./.. not found
it seems like the parent directory is missiong...how can this be possible?
bc we can't remove .. or . or can we?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2003 01:19 AM
02-03-2003 01:19 AM
Re: silly question about "which"
unmount the fs, check the permissions of the
directory (should be 555, not 000), and remount the fs. Worked for me once.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2003 01:31 AM
02-03-2003 01:31 AM