LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices


Reply
  Search this Thread
Old 09-16-2009, 02:10 PM   #1
Cerephim
Member
 
Registered: Mar 2005
Location: Dayton, Ohio
Distribution: CentOS
Posts: 49

Rep: Reputation: 0
Smile need a command or script for verifying users...


I just took over for the old Linux admin...

I'm trying to figure out how to verify if some users who have a home directory 'owner' of their Active Directory Userid are indeed valid users.

So far, I've done:

find . -nouser -type d | grep -v .kde

but the results are less than satisfactory...

Example:
./joe.setty
./joe.setty/src
./joe.setty/us
./joe.setty/us/xx

I'd like just the name on the home directory, without all the subdirectories.

Once that is done, I'd like to pipe the output to a 'finger' command, to see if the user is valid.

Any ideas?

Many thanks!

 
Old 09-16-2009, 02:15 PM   #2
Cerephim
Member
 
Registered: Mar 2005
Location: Dayton, Ohio
Distribution: CentOS
Posts: 49

Original Poster
Rep: Reputation: 0
Okay, I've figured out how to use the -maxdepth 1 option on find...

Now all I have to do is strip off the leading "./" before piping the output to finger.

How do I do that?
 
Old 09-16-2009, 02:32 PM   #3
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by Cerephim View Post
Okay, I've figured out how to use the -maxdepth 1 option on find...

Now all I have to do is strip off the leading "./" before piping the output to finger.

How do I do that?
pipe to

Code:
sed -e's#^\.\/##g'| xargs finger
or
pipe to

Code:
cut -c3-

Last edited by centosboy; 09-16-2009 at 02:41 PM.
 
Old 09-16-2009, 02:53 PM   #4
Cerephim
Member
 
Registered: Mar 2005
Location: Dayton, Ohio
Distribution: CentOS
Posts: 49

Original Poster
Rep: Reputation: 0
Excellent!
Exactly what I was looking for. Thank you VERY much.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Script to Auto-add Domain Users to Workstation Power Users Group doesn't work avinash.rao Ubuntu 0 08-22-2009 04:57 AM
Script to add a secondary group to all users except system default users Tekken Linux - Server 5 06-29-2009 04:02 PM
busybox command works, same command within script says permission denied jeroenv Linux - Newbie 2 01-17-2009 02:58 AM
Multiple users with the same name...users command buldir Linux - General 2 08-30-2004 04:34 PM
[FC2]Why does the users command display multiple users? Harkov Fedora 1 07-10-2004 09:24 PM

LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise

All times are GMT -5. The time now is 01:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration