- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: What's wrong with this FIND command?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-23-2004 04:51 AM
тАО06-23-2004 04:51 AM
find $DATADIR ! -group oradvlp -exec ls -l {} \;
It returns such lines as:
-rw-r----- 1 sched oradvlp 1222 Feb 13 2003 wires.dat021306.gz
-rw-r--r-- 1 sched oradvlp 3833 Dec 11 2002 wires.dat121009.gz
-rw-r----- 1 sched oradvlp 910 Dec 11 2002 wires.dat121209.gz
I know that the group id is a number, but when "ls" translates it back, doesn't it use that to find the group name in /etc/group?
Solved! Go to Solution.
- Tags:
- find
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-23-2004 05:00 AM
тАО06-23-2004 05:00 AM
SolutionTry this
find $DATADIR -type f ! -group oradvlp -exec ls -l {} \;
In your command you see files under directory, which doesn't belong to group oradvlp
In order to see only directories use
-type d and ls -ld {} \;
HTH
- Tags:
- ls
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-23-2004 05:00 AM
тАО06-23-2004 05:00 AM
Re: What's wrong with this FIND command?
Try this:
find $DATADIR ! -group oradvlp -print | xargs ls -l {} \;
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-23-2004 05:03 AM
тАО06-23-2004 05:03 AM
Re: What's wrong with this FIND command?
727
$ find /etc -group sys -exec ls -ld {} \; 2>/dev/null | wc -l
432
$ find /etc -exec ls -ld {} \; 2>/dev/null | wc -l
1159
$ expr 727 + 432
1159
=> works perfectly here...
could you do "ls -n" (no gid convertion in output) and a "grep oradvlp /etc/group" ?
Regards,
Fred
"Reality is just a point of view." (P. K. D.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-23-2004 05:05 AM
тАО06-23-2004 05:05 AM
Re: What's wrong with this FIND command?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-23-2004 05:08 AM
тАО06-23-2004 05:08 AM
Re: What's wrong with this FIND command?
Note that output from find was piped to xargs(1) instead of using
the -exec primary. This is because when a large number of files
or directories is to be processed by a single command, the -exec
primary spawns a separate process for each file or directory,
whereas xargs collects file names or directory names into
multiple arguments to a single chmod command, resulting in fewer
processes and greater system efficiency.
Rgds...Geoff
- Tags:
- xargs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-23-2004 05:08 AM
тАО06-23-2004 05:08 AM
Re: What's wrong with this FIND command?
I would go with what Victor has suggested.
The filenames in the output doesnt include any directory name so I assume these files belong to the directory that is NOT owned by group oradvlp.
# find $DATADIR ! -group oradvlp -exec ls -ld {} \;
-- Sundar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-23-2004 05:08 AM
тАО06-23-2004 05:08 AM
Re: What's wrong with this FIND command?
Hope this helps explaining the situation.
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-23-2004 05:10 AM
тАО06-23-2004 05:10 AM
Re: What's wrong with this FIND command?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-23-2004 05:11 AM
тАО06-23-2004 05:11 AM
Re: What's wrong with this FIND command?
The directory that contains the files is probably not owned by group oradvlp. When you issue "ls -l" on it, you see those files.
If you only want files, use Victor's solution. If you want directories too, use "ls -ld" instead of "ls -l" (directory will be shown instead of their content)
Regards,
Fred
"Reality is just a point of view." (P. K. D.)