Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using the find command with wildcard

Status
Not open for further replies.

mrbernsca

MIS
Jan 10, 2008
15
0
0
CA
Hey Guys,

Need some help ..

find / -user username -print shows me all files in the system that are owned by a specific user ....

Does anyone know how to each for a string in the user name ...

i.e. user ids on the box are bill, bob, bart and I will search for all files owned by b* (covers all the names above)????

Thx.
 
Well, find uses the numeric user ids to search for, as that is also what is stored in the files' inodes. So I don't think [tt]find / -user 'b*' -print[/tt] will work...

What does work is this:
[tt]find / \( -user bill -o -user bob -o -user bart \) -print[/tt]

And actually you don't need to specify the [tt]-print[/tt] so like this you don't even need the brackets:
[tt]find / -user bill -o -user bob -o -user bart -print[/tt]



HTH,

p5wizard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top