shell-init: could not get current directory: getcwd: cannot access parent directories


 
Thread Tools Search this Thread
Operating Systems Solaris shell-init: could not get current directory: getcwd: cannot access parent directories
# 1  
Old 10-03-2008
shell-init: could not get current directory: getcwd: cannot access parent directories

Hello

Code:
 
 
root@ne-ocadev-1:/root/scripts>su espos -c find /a35vol100/ESPOS/oracle/db/9.2.0/oradata/ESPOS/archive -type f -atime +10 -exec ls {}
 
shell-init: could not get current directory: getcwd: cannot access parent directories: Permission denied
 
find: insufficient number of arguments
find: path-list predicate-list
 
root@ne-ocadev-1:/root/scripts>su espos -c find /a35vol100/ESPOS/oracle/arc -type f -atime +10 -exec ls {}
 
shell-init: could not get current directory: getcwd: cannot access parent directories: Permission denied
find: insufficient number of arguments
find: path-list predicate-list
 
root@ne-ocadev-1:/root/scripts>id
uid=0(root) gid=1(other)
 
root@ne-ocadev-1:/root/scripts>su espos -c find /ESPOS/oracle/arc -type f -atime +10 -exec ls {};
 
shell-init: could not get current directory: getcwd: cannot access parent directories: Permission denied
find: insufficient number of arguments
find: path-list predicate-list
 
root@ne-ocadev-1:/root/scripts>id
uid=0(root) gid=1(other)
 
root@ne-ocadev-1:/root/scripts>su - espos
Sun Microsystems Inc. SunOS 5.9 Generic May 2002
You have new mail.
 
ne-ocadev-1(on ) DB:ESPOS User:espos
/ESPOS/oracle/db/9.2.0> cd ..
ne-ocadev-1(on ) DB:ESPOS User:espos
/ESPOS/oracle/db> cd ..
ne-ocadev-1(on ) DB:ESPOS User:espos
/ESPOS/oracle> cd arc/
ne-ocadev-1(on ) DB:ESPOS User:espos
 
/ESPOS/oracle/arc> ls -lrt | wc -l
885
 
ne-ocadev-1(on ) DB:ESPOS User:espos
/ESPOS/oracle/arc> pwd
/ESPOS/oracle/arc
ne-ocadev-1(on ) DB:ESPOS User:espos
/ESPOS/oracle/arc> su - root
Password:
Sun Microsystems Inc. SunOS 5.9 Generic May 2002
 
root@ne-ocadev-1:/root>su espos -c find //ESPOS/oracle/arc -type f -atime +10 -exec ls {}
shell-init: could not get current directory: getcwd: cannot access parent directories: Permission denied
find: insufficient number of arguments
find: path-list predicate-list

Please help for this issue.
# 2  
Old 10-03-2008
Is this an intermittent problem?
# 3  
Old 10-03-2008
Thanks for your support.

I'm not sure thsis intermittent problem.

but if i connect 'Espos' user i can able to read all file but throw root user i can't do any thing.

I need to give any permission?

Babu
# 4  
Old 10-03-2008
What are the special priviledges for the Epos user under the profile? What shell is it using by default? By right, root should be able to do anything, but in your circumstances, I would rather take thru the step by step troubleshooting step to see "what root is missing" .. Smilie
# 5  
Old 10-03-2008
Is /root/scripts NFS mounted ?
# 6  
Old 10-03-2008
looking at the command... shouldn't you fail to complete the command? you need `.... -exec ls {} \;` or `... -exec ls {} +`
# 7  
Old 10-03-2008
Quote:
Originally Posted by babu.knb
Hello

Code:
 
root@ne-ocadev-1:/root/scripts>su espos -c find /ESPOS/oracle/arc -type f -atime +10 -exec ls {};

shell-init: could not get current directory: getcwd: cannot access parent directories: Permission denied
Please help for this issue.

Mmmmm, may be you cannot access parent directories by user espos ? Smilie
Likely you have not rigth to read or exec on this dir.check it:
pwd
ls -la

if it looks like this
drwx------
you can't read this directory by another user (only root or master of dir)
When you write 'su espos' you will get only effective id of user espos, you stay in directory where you are (but user espos cannot read in this dir)

I guess you need test this
su - espos -c 'find /ESPOS/oracle/arc -type f -atime +10 -exec ls {} \;'


su 'dash' user
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

List all files and directories in the current directory separated by commas and sorted by crtime

What I know so far: ls -A will list all files except those starting with a dot ls -d will list all directories ls -m will separate contents by commas For getting crtimes use: stat filename will give me the inode number or ls -i filename will give... (13 Replies)
Discussion started by: chstewar
13 Replies

2. Shell Programming and Scripting

Shell script to check current date file is created and with >0 kb or not for multiple directories

Hi All, I am new in scripting and working in a project where we have RSyslog servers over CentOS v7 and more than 200 network devices are sending logs to each RSyslog servers. For each network devices individual folders create on the name of the each network devices IP addresses.The main... (7 Replies)
Discussion started by: Pinaki
7 Replies

3. UNIX for Advanced & Expert Users

Find all files in the current directory excluding hidden files and directories

Find all files in the current directory only excluding hidden directories and files. For the below command, though it's not deleting hidden files.. it is traversing through the hidden directories and listing normal which should be avoided. `find . \( ! -name ".*" -prune \) -mtime +${n_days}... (7 Replies)
Discussion started by: ksailesh1
7 Replies

4. Shell Programming and Scripting

Find specific files only in current directory...not sub directories AIX

Hi, I have to find specific files only in the current directory...not in the sub directories. But when I use Find command ... it searches all the files in the current directory as well as in the subdirectories. I am using AIX-UNIX machine.Please help.. I am using the below command. And i am... (2 Replies)
Discussion started by: aakishore
2 Replies

5. Shell Programming and Scripting

How to list all the files, directories and sub-directories in the current path except one directory?

Can anyone come up with a unix command that lists all the files, directories and sub-directories in the current directory except a folder called log.? Thank you in advance. (7 Replies)
Discussion started by: Manjunath B
7 Replies

6. Shell Programming and Scripting

forking a child process and kill its parent to show that child process has init() as its parent

Hi everyone i am very new to linux , working on bash shell. I am trying to solve the given problem 1. Create a process and then create children using fork 2. Check the Status of the application for successful running. 3. Kill all the process(threads) except parent and first child... (2 Replies)
Discussion started by: vizz_k
2 Replies

7. Shell Programming and Scripting

mget * (obtein files from current directory but not the files form sub-directories)

Hello, Using the instruction mget (within ftp) and with "Interactive mode off", I want to get all files from directory (DirAA), but not the files in sub-directories. The files names don't follow any defined rule, so they can be just letters without (.) period Directory structure example: ... (0 Replies)
Discussion started by: Peter321
0 Replies

8. UNIX for Dummies Questions & Answers

List files that are not directories from current directory

I can't manage to list all files that are not directories from current directory. (2 Replies)
Discussion started by: beni22sof
2 Replies

9. Shell Programming and Scripting

Recursive call to find files and directories in Shell script from current path.

################################################################ Copy this script to your path from where you want to search for all the files and directories in subdirectories recursively. ################################################################# code starts here... (2 Replies)
Discussion started by: Ramit_Gupta
2 Replies

10. UNIX for Dummies Questions & Answers

Listing only directories in the current working directory using the "ls" command

Hello All, I am trying to list only directories in my current directory using the command "ls -d". But the output only contains the default directory "." and doesn't list the rest of the directories in the working directory. Can anyone explain why this is happening (2 Replies)
Discussion started by: igandu
2 Replies
Login or Register to Ask a Question