Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Strange Directory Issue 1

Status
Not open for further replies.

Dagon

MIS
Jan 30, 2002
2,301
GB
I'm using Sun Solaris and I find that if I cd to one particular directory and do an ls, no files are listed. It doesn't matter what options I use on the ls command (I've tried -l, -f, -a). Adding an argument like a filename or directory makes no difference.

However, if I do cd .. and then list the directory using "ls dirname", I can see all the files. Likewise, if I cd to a subdirectory and do ls .., it's fine. The ID I'm using owns the directory but not most of the files in it. If I log in to the account which does own the files, the ls works correctly.

Protections on the directory seem reasonable. It's drwxrwxr-x and the fles are mostly -rwxrwxr-x. The two IDs are in the same group, so should be able to see each other's files. I suppose it must be a problem with protections but it's odd that I seem to be able to list the contents from outside the directory but not when I'm in it.

 
This may be a silly question, but is there a file named ls in the directory in question?
And what is your $PATH variable?
 
Yes, that's it. I just did an "rm -ls" and it now works fine. I should have thought of that !

 
Well guessed hoinz!

Dagon, you should probably remove '.' from your PATH as it is risky for reasons like you just discovered.

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top