Finding directories when logged in as normal user

Posted on 2007-07-27
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 45

    Accepted Solution

    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 84

    Expert Comment

    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

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    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…
    Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
    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…
    This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

    745 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

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now