Listing users with certain subfolders

I have alot of users in a /home directory...i wish to display all of those users who have a /web directory contained within there home directory.

eg. i wish to display all users who have a directory that looks something like /home/johnsmith/web

I do not wish to view the contents of the web directory, i just want to know if they have one.

Any help would be much appreciated.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

find /home -type d -name web -print
cd /home

ls -lR */ | grep web
ls -ld */web
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

ls -d */web  (if you don't need the perms/date...)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
cd /home
find . -print | grep web
Change directory to your /home area and run the following:

find . -type d -ls -name web

This will give you an output that you desire and you can parse out the usernames

Just typing find . -type d -name web will also work
The output will look something like this :


The second forward slash will be the filed seperator for your username which you can extract using awk/sed


It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Unix OS

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.