- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Simple 'find' command question
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
Forums
Discussions
Discussions
Discussions
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
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
05-27-2004 03:09 AM
05-27-2004 03:09 AM
Is there a way of issuing the 'find' command to poll for â file ownerâ ? I have tried the below command with no luck
# find /home -user *ftp*
find: missing conjun
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2004 03:11 AM
05-27-2004 03:11 AM
Re: Simple 'find' command question
find /home -user ftp
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2004 03:12 AM
05-27-2004 03:12 AM
Re: Simple 'find' command question
It would need to be "find /home -user ftp".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2004 03:13 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2004 03:22 AM
05-27-2004 03:22 AM
Re: Simple 'find' command question
find /home -user +101
find /home -user -101
find /home -user 101
find doesn't allow regular expressions for option to -user.
Anshu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2004 03:27 AM
05-27-2004 03:27 AM
Re: Simple 'find' command question
-user uname True if the file belongs to the user uname.
If uname is numeric and does not appear as a
login name in the /etc/passwd file, it is
taken as a user ID. The uname operand can be
preceded by a + or - to modify the comparison
of the primaries. If the argument n
represents a decimal integer; +n means more
than n, -n means less than n, and n means
exactly n.
find /home -user ftp
Find only user with uis 21100
or find /home -user 21100
Find all users greater then uid 21099
or find /home -user +21099
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2004 03:30 AM
05-27-2004 03:30 AM
Re: Simple 'find' command question
That is not right,
# cd /home
# find . -user gorj -type f -exec ll {} \;
-rwxr-xr-x 1 gorj users 65 Apr 20 13:03 .history
-rwxr-x--- 1 gorj users 341 Jun 13 2000 .login
-rw------- 1 gorj users 19124 Mar 25 10:51 .lsof
-rwxr-x--- 1 gorj users 1768 May 17 09:46 .profile
regards,
Robert-Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2004 03:32 AM
05-27-2004 03:32 AM
Re: Simple 'find' command question
for username in `cat /etc/passwd | cut -d: -f1 | grep ftp`
do
find /home -user $username
done
Hope this helps
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2004 03:39 AM
05-27-2004 03:39 AM
Re: Simple 'find' command question
Try the following lines:
USERS=`cat /etc/passwd|awk -F":" '{ print $1 }'|grep ftp`
for USER in $USERS
do
find /home -user $USER
done
If you need more information about found files replace previously "find" sintax by this:
find /home -user $USER -exec ll {} \;
BR.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2004 04:12 AM
05-27-2004 04:12 AM
Re: Simple 'find' command question
I want to thank you all for the information and perspective you have afforded me. I think of all, Mel Burslan is the closest to what Iâ m looking for - files that have ftp as a part of their owner
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2004 10:59 AM
05-27-2004 10:59 AM
Re: Simple 'find' command question
you can specify wild card * for searching in the quotes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2004 01:13 PM
05-27-2004 01:13 PM
Re: Simple 'find' command question
Based on your example you used in your question, Iminus was closest to your answer.
If you are looking for any user with ftp in the name (i.e. tftpuser) you would need to enclose the ftp in quotes with an asterisk before and after ...
# find /home -user "*ftp*"
If you are looking for a user with
# find /home -user *ftp
Same for the reverse ... ftp
# find /home -user ftp*
Your example shows two asterisks, so you would use the first example I show above.
Good luck!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2004 05:05 AM
05-28-2004 05:05 AM