?
Solved

Listing users with certain subfolders

Posted on 2003-03-03
8
Medium Priority
?
307 Views
Last Modified: 2010-05-18
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
Comment
Question by:decoy22
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 21

Expert Comment

by:tfewster
ID: 8062808
find /home -type d -name web -print
0
 
LVL 1

Expert Comment

by:GeneriK
ID: 8064379
cd /home

ls -lR */ | grep web
0
 
LVL 1

Expert Comment

by:Jaem
ID: 8071177
ls -ld */web
0
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

 
LVL 1

Accepted Solution

by:
Jaem earned 200 total points
ID: 8071181
ls -d */web  (if you don't need the perms/date...)
0
 
LVL 9

Expert Comment

by:HamdyHassan
ID: 8071188
cd /home
find . -print | grep web
0
 

Expert Comment

by:roy911
ID: 8074434
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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question