To find the username in /etc/passwd file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting To find the username in /etc/passwd file
# 1  
Old 12-26-2008
To find the username in /etc/passwd file

Hi,

I need to a shell script to list out only the username in the /etc/passwd file.

Regards
Siva
# 2  
Old 12-26-2008
Code:
cut -d":" -f1 /etc/passwd

This User Gave Thanks to joeyg For This Post:
# 3  
Old 12-26-2008
Hi joeyg:

Its works man. Thank you.....

Also, One more doubt, I would like to list all the files and directories in the box with the full permission .
# 4  
Old 12-26-2008
Hammer & Screwdriver

Code:
> ls -laR

# 5  
Old 12-26-2008
Sorry, I mean that I need to take a list all the files and directories in the box which holds the 777 permission. I hope that makes sense....
# 6  
Old 12-26-2008
Hammer & Screwdriver Perhaps something like

Code:
> find . -perm 777 -print

The above will issue the command from your corrent directory. Try that way before using a / in place of the . for your own testing.
# 7  
Old 12-26-2008
Hi,

Thank you, I got the list of files and directories with the 777 permission. Now, I should have to change all the 777 directories to 755 and files to 644 with the help of shell scripting.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. SuSE

SUSE "passwd username" ask for password 4 times

Below is the error I'm getting. # passwd username Changing password for username. New Password: Reenter New Password: Password changed. New UNIX password: Retype new UNIX password: Password has been already used. Choose another. passwd: Authentication token manipulation error# cat... (0 Replies)
Discussion started by: toor13
0 Replies

2. AIX

When did AIX start using /etc/security/passwd instead of /etc/passwd to store encrypted passwords?

Does anyone know when AIX started using /etc/security/passwd instead of /etc/passwd to store encrypted passwords? (1 Reply)
Discussion started by: Anne Neville
1 Replies

3. Solaris

Forget ILOM Username passwd, how to reterive it from OS with out rebooting

Hi Every One, Is their any command or solution to retrieve ILOM username and password from Solaris OS without rebooting or resetting. Thanks (3 Replies)
Discussion started by: bobby320
3 Replies

4. UNIX and Linux Applications

grep file to find unique instances of username

hello - A SystemOut.log file has recurring entries that follow this format: Principal: auth9.nick.al.gov:389/USERNAME Over the course of a day thousands of lines similar to this are produced, with each username represented hundreds of times. I need to create a new file that shows... (4 Replies)
Discussion started by: 1075FJ40
4 Replies

5. UNIX for Dummies Questions & Answers

Easy Script, just to find the given username if is it online or not

hey guys plz help me..with shell script. i must find the given(the user types a username) username if is it login or not.. i know how to do it logically, but i think that i can't in scripting. Thank you all (5 Replies)
Discussion started by: aintour
5 Replies

6. Shell Programming and Scripting

Find username of user running the script

Hello All, If I have a simple cgi script and want to find the name of the person accessing the page, is it possible? How do I get the name of this user? Please help. I was trying a vague method but it doesn't seem to work with all browsers and versions ... $val=$ENV{'HTTP_COOKIE'}; $name... (1 Reply)
Discussion started by: garric
1 Replies

7. UNIX for Dummies Questions & Answers

Find, make and move file based on username

hi there, i'm new to UNIX( just 3month used), i found my new box contained alot of files and directories in /home/box/ i've tried to search script in tis forum and found many of them but, i don't know how to combine them to make a script, although using pipes. my tasks are: 1) to scan user... (5 Replies)
Discussion started by: Helmi
5 Replies

8. AIX

How do I read username and lastupdate attribute values from /etc/security/passwd

Hi, How do I read username and lastupdate attribute values from /etc/security/passwd file and write the obtained data to another file. The data in the new file should be in this format as shown: avins:12345 root:45234 xyza:23423 Plese let me know this ASAP Thanks, Haroon (3 Replies)
Discussion started by: me_haroon
3 Replies

9. AIX

I want to read username and lastupdate only from /etc/security/passwd and write the s

Hi All, As i asked you in my previous post, I want to read username and lastupdate only from /etc/security/passwd and write the same data to another file: The data in /etc/security/passwd will be in this form for example: smith: password = MGURSj.F056Dj lastupdate = 623078865 flags =... (0 Replies)
Discussion started by: me_haroon
0 Replies

10. UNIX for Dummies Questions & Answers

How to find who fingered my username

Hi Everyone, Whenever someone uses the finger command against my username, he.she gets my info. Is there a way to find who ran the command against my username, somewhat like a log file for the finger command. I would be greatful if someone to clear my query. Regards Anirudh Koul... (3 Replies)
Discussion started by: anirudhkoul
3 Replies
Login or Register to Ask a Question