Finding directories when logged in as normal user

Posted on 2007-07-27
Medium Priority
Last Modified: 2010-04-21
I login to HP-UX with a account abc.

I want to find directories 'COC, DCM, SFA, & DWH' with it's complete path.

I use find / -name 'COC' -name 'DCM' -name 'SFA' -name 'DCW' -type d

and unix displays a list of files it could not open (as it does not have administrative permission)

find: cannot open <complete path>

I also try locate command. However, it shows a list of files (not directories) with names COC,DCM etc.

I doubt if the locate 'database' is updated.

When i try updatedb command, the system responds with Permission denied message.

How do i check the complete path of directories under user abc:
Question by:gram77
LVL 46

Accepted Solution

Kent Olsen earned 2000 total points
ID: 19581551
Hi gram,

find (and other search tools) can not search a directory that it is not authorized to read.  The authority is based on the user's permission.

The best that you can do is repeat the find command, piping errors to /dev/null so that you don't have to deal with them, or run the find command from root.

    find / -name 'COC' -name 'DCM' -name 'SFA' -name 'DCW' -type d  2>/dev/null

Good Luck,

LVL 85

Expert Comment

ID: 19582265
you can never find -name 'COC' -name 'DCM' -name 'SFA' -name 'DCW'
because anything that satisfies one will fail the others
you probably want
find / \( -name 'COC' -o -name 'DCM' -o -name 'SFA' -o -name 'DCW' \) -type d  2>/dev/null

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses
Course of the Month13 days, 18 hours left to enroll

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question