List shell of specific account

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat List shell of specific account
# 1  
Old 03-02-2011
List shell of specific account

Hi everyone. I am wondering how I would accomplish outputting the shell of a specific account on a single line of output. For example I would like to list the shell of 'news' as...

Code:
/bin/sh

providing its current shell is /bin/sh. This probably is a simple answer that I haven't been able to locate anywhere...

Thanks in advance for any help!
# 2  
Old 03-02-2011
Code:
grep '^news:' /etc/passwd | cut -f 7 -d:


Last edited by fpmurphy; 03-02-2011 at 11:58 PM..
# 3  
Old 03-02-2011
Code:
awk -F: '/^news/ { print $7 }' /etc/passwd

Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. AIX

How to list Inactive user account in AIX 5.3?

Hello, I have a situation, where I ask for to get a list of all inactive users (expire or locked in last 41 days). I looked into /etc/shadow (no such file in my server). I referred some old threads but not found useful information. I'm using AIX 5.3 .... I have total 1641 users in server. ... (5 Replies)
Discussion started by: sumit30
5 Replies

2. Red Hat

How to list shell of account?

Hello. I have been trying to figure out something very simple that I know I've done before; which is list the shell of a specific account. In this case it is the account: "news". I know how to change the shell using chsh, just not list it. I want output like "/bin/sh" only. Any thoughts or... (5 Replies)
Discussion started by: austinharris43
5 Replies

3. UNIX for Dummies Questions & Answers

How do i list all locked account in linux?

Hi How do i list all locked account in my linux distributiion I have tried passwd -S -a but it seems to not working . My distribution details. # lsb_release -a LSB Version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch Distributor ID: OracleVMserver... (3 Replies)
Discussion started by: pinga123
3 Replies

4. Shell Programming and Scripting

Shell script or command help to extract specific contents from a long list of content

Hi, I got a long list of contents: >sequence_1 ASSSSSSSSSSSDDDDDDDDDDDCCCCCCC ASDSFDFFDFDFFWERERERERFSDFESFSFD >sequence_2 ASDFDFDFFDDFFDFDSFDSFDFSDFSDFDSFASDSADSADASD ASDFFDFDFASFASFASFAFSFFSDASFASFASFAFS >sequence_3 VEDFGSDGSDGSDGSDGSDGSDGSDG dDFSDFSDFSDFSDFSDFSDFSDFSDF... (2 Replies)
Discussion started by: patrick87
2 Replies

5. Shell Programming and Scripting

Locking specific account without using passwd

Hey guys just wondering how i could lock a specific acount by prepending LK to the password field in the /etc/shadow file. it cannot be done through a command since the script gets called by a menu driven interface so i cant use "passwd". Is there a way where i can search for a specific account... (11 Replies)
Discussion started by: musicmancanora
11 Replies

6. AIX

AIX shell account

I am just wondering if there is a way I can obtain a free shell account for an AIX server that I can make test drive on it. I tried google search and ibm's web site but couldn't find anything.. regards, (2 Replies)
Discussion started by: milhan
2 Replies

7. UNIX for Dummies Questions & Answers

Where can I get a Free Shell Account?

I am new to UNIX and am interested to practice on a Shell account with some basic Unix installed, does anyone know of a free or cheap shell account? (4 Replies)
Discussion started by: shneurg
4 Replies

8. UNIX for Dummies Questions & Answers

unix shell account

i purchased a unix shell account and got myself into a bit of trouble with my providers heh i got 3 automated emails telling me i had 3 background processes running, and my limit is two, which i knew. after a couple of emails between myself and a human being, he suggested i look up... (2 Replies)
Discussion started by: turf
2 Replies
Login or Register to Ask a Question