Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 314
  • Last Modified:

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.
0
decoy22
Asked:
decoy22
1 Solution
 
tfewsterCommented:
find /home -type d -name web -print
0
 
GeneriKCommented:
cd /home

ls -lR */ | grep web
0
 
JaemCommented:
ls -ld */web
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
JaemCommented:
ls -d */web  (if you don't need the perms/date...)
0
 
HamdyHassanCommented:
cd /home
find . -print | grep web
0
 
roy911Commented:
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 :

./home/joe/web
./home/sue/files/web

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

regards

RR
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now