cannot determine current directory


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users cannot determine current directory
# 1  
Old 11-08-2006
cannot determine current directory

Hi,
when I execute some simple commands on my solaris system, I am getting the following warning message:

Could anybody tell me what could be the reason

Ex:- If I give the command,
which ls
Warning: cannot determine current directory
/usr/bin/ls

Thanks in advance
axes
# 2  
Old 11-08-2006
please post the output from "df -h" or "df -k" maybe the /var filesystem is full....? and what is the output of "pwd"?
# 3  
Old 11-08-2006
The output of df -k is:-

Filesystem kbytes used avail capacity Mounted on
/dev/md/dsk/d0 10332460 1607447 8621689 16% /
/proc 0 0 0 0% /proc
fd 0 0 0 0% /dev/fd
mnttab 0 0 0 0% /etc/mnttab
swap 11718104 8 11718096 1% /var/run
/dev/md/dsk/d40 5170926 1516632 3602585 30% /crash
/dev/md/dsk/d20 5170926 2650269 2468948 52% /tmp
/dev/md/dsk/d30 3080879 114518 2904744 4% /seos
/dev/md/dsk/d50 25817063 650972 24907921 3% /home
/dev/md/kplusintfsds/dsk/d0
10317788 811904 9402707 8% /home/applications
/dev/md/kplusintfsds/dsk/d10
25800247 10126982 15415263 40% /files_local
/dev/md/kplusintfsds/dsk/d20
15115195 1471029 13493015 10% /kreditnet
/dev/md/kplusintfsds/dsk/d30
10317788 134825 10079786 2% /kpatches
/dev/md/kplusintfsds/dsk/d40
25195256 7123432 17819872 29% /dump
/dev/md/kplusintfsds/dsk/d50
25195256 3878854 21064450 16% /proddump

If i give, man ls command,it is displaying error message as
getcwd: Permission denied

If i run the commands from the (/) file system, they are working fine
whereas If i run commands from my directory it is giving the above error messages.

Thanks for ur response
axes
# 4  
Old 11-08-2006
your filesystem is fine.. seems like some rights problem occure....
# 5  
Old 11-08-2006
There is one scenario where this can happen.
You are in a directory. And somebody else might have deleted the directory without your knowledge.

Change to a different directory and try.
justsam
# 6  
Old 11-08-2006
Quote:
Originally Posted by justsam
There is one scenario where this can happen.
You are in a directory. And somebody else might have deleted the directory without your knowledge.

Change to a different directory and try.
yeah, you are right... or a filesystem ist unmountet without your knowledge...
# 7  
Old 11-08-2006
My directory still exists. If I go to a different directory it is working.
How to check whether the file system is unmounted or
mounted with wrong permissions.

Thanks
axes
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Current working directory

Hi all, How do I print the name of my current working directory only to screen? Not pwd! For example, if I was in /home/work I am looking for 'work' only (4 Replies)
Discussion started by: jimjam
4 Replies

2. UNIX for Advanced & Expert Users

current directory in awk

Hello, I want to use the string with the current directory in my awk command. I tried: 'pwd=system("pwd")' but it doesn't work. can please help somebody? (2 Replies)
Discussion started by: daWonderer
2 Replies

3. Shell Programming and Scripting

How to determine if there's a file in directory!

Hi All, I'm just wondering how can i determined if there's a file in directory and put it in a logs? dir="/home/test/" Please advise, Thanks, Use code tags, thanks. (1 Reply)
Discussion started by: nikki1200
1 Replies

4. Shell Programming and Scripting

tarball of current directory

I wanna make a backup tarball. I wanna write a script that makes tarball of the current directory. There are lots of files so I cant type all files, I wanna make the tarball by excluding few files. Like there 1000 files in a directory I wanna create a tarball containing 98 files of that... (1 Reply)
Discussion started by: nishrestha
1 Replies

5. UNIX for Dummies Questions & Answers

Determine FULL name of current script

Hi everyone, Is there a slick way to determine the FULL name of a script that is running? The variable ${0} just gives the relative path name. I guess I could just do the following: FULL_SCRIPT_NAME=${PWD}${0}Although that's pretty simple is there another way that I am missing? ... (4 Replies)
Discussion started by: msb65
4 Replies

6. Shell Programming and Scripting

[Perl] Determine directory name

Hi there, I wonder if it is possible the determine a name of a directory which is different on various hosts. Let me try to explain. I have the directory /tmp/dir1/dir2/canchangedir. This directory name is different on various hosts. I need to use the directory name, independent from the... (2 Replies)
Discussion started by: ejdv
2 Replies

7. Shell Programming and Scripting

Finding files in current directory when 100,000's files in current directory

Hi All I was wondering what is the most efficient way to find files in the current directory(that may contain 100,000's files), that meets a certain specified file type and of a certain age. I have experimented with the find command in unix but it also searches all sub directories. I have... (2 Replies)
Discussion started by: kewong007
2 Replies

8. UNIX for Advanced & Expert Users

How Can I Easily Determine If A File Has been Added to a Directory

I am uploading files that need to be processed prior to uploading. I will put the files in a directory. My question is how can I write an easy process to kick off a script once a file has been added? Is there an easy way to determine if a file has been added to a directory? Thanks (7 Replies)
Discussion started by: goodmis
7 Replies

9. UNIX for Dummies Questions & Answers

How Can I Easily Determine If A File Has been Added to a Directory

I am uploading files that need to be processed prior to uploading. I will put the files in a directory. My question is how can I write an easy process to kick off a script once a file has been added? Is there an easy way to determine if a file has been added to a directory? Thanks (1 Reply)
Discussion started by: goodmis
1 Replies

10. Shell Programming and Scripting

determine owner directory permissions from within the directory

From within a directory, how do I determine whether I have write permission for it. test -w pwd ; echo ? This doesn't work as it returns false, even though I have write permission. (4 Replies)
Discussion started by: Sniper Pixie
4 Replies
Login or Register to Ask a Question