Sponsored Content
Operating Systems Solaris shell-init: could not get current directory: getcwd: cannot access parent directories Post 302242984 by ikorolev on Friday 3rd of October 2008 10:11:21 AM
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
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
CHROOT(8)						    BSD System Manager's Manual 						 CHROOT(8)

NAME
chroot -- change root directory SYNOPSIS
chroot [-u user] [-g group] [-G group,group,...] newroot [command] DESCRIPTION
The chroot utility changes its current and root directories to the supplied directory newroot and then exec's command, if supplied, or an interactive copy of the user's login shell. If the -u, -g or -G options are given, the user, group and group list of the process are set to these values after the chroot has taken place. ENVIRONMENT
The following environment variable is referenced by chroot: SHELL If set, the string specified by SHELL is interpreted as the name of the shell to exec. If the variable SHELL is not set, /bin/sh is used. SEE ALSO
chdir(2), chroot(2), setgid(2), setgroups(2), setuid(2), getgrnam(3), environ(7), jail(8) HISTORY
The chroot utility first appeared in 4.4BSD. BSD
June 7, 2003 BSD
All times are GMT -4. The time now is 07:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy