How to obtain list of users ?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to obtain list of users ?
# 1  
Old 04-09-2007
Question How to obtain list of users ?

How to obtain list of users found in /home/ and append it to a file.
# 2  
Old 04-09-2007
In case your machine is not an network, You can get the list of users from /etc/passwd file

In case of NFS,try ypcat passwd

Also try ls -ld /home/*/

Thanks,
Nagarajan Ganesan
# 3  
Old 04-09-2007
thanks nagarajan but i cannot append it to file .Is it because am using putty.I want the users append to a file.
# 4  
Old 04-09-2007
You use PuTTy to connect to the Unix box from the Windows client? If so then shouldn't be a problem.

What is the error you get when u try to output the results to a file?

Thanks
Nagarajan Ganesan
# 5  
Old 04-09-2007
It gives me the followin error msg
Code:
-bash : permission denied

am using
ls -l >> <filename> to append the list of users in /home/

ls-l and ls -ld/home/*/ r giving the same output so used ls-l

kind regards

Last edited by Yogesh Sawant; 02-10-2011 at 05:50 AM.. Reason: added code tags
# 6  
Old 04-09-2007
It seems that you dont permisson to the directory where you are creating the outfile.

Check if the current directory from which you tried to run the command,has the write access or create the Output to the some other directory to which you have write access.

You could try writing it to either some directory under your home or use /tmp

ls -ld /home/*/ > /tmp/OutFile
(or)
ls -ld /home/*/ > /home/<YourLogin>/OutFile

Thanks
Nagarajan Ganesan.
# 7  
Old 04-09-2007
hi ganeshan,

I'm appending the list of users to a file which i have created and the list of users
donot have permission to group and others.So I guess becoz of tht I'm not able to accomplish it.

thanks for ur time ganeshan
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

List the Manager of Users in AD - Using list- Get-ADuser

Is there any command that can used in Linux that export usernames and their manager's name from AD using bash shell script? I know this can be done using powershell but I need to use Linux for this procedure. (2 Replies)
Discussion started by: dellanicholson
2 Replies

2. AIX

Get List of users+IPs

Hello! We have an AIX box (6.3), we are looking for a way to get list of logged in users and their IP. The issue we have is running who -ub shows hostname and we are wanting to get the ip. Any suggestions of ideas? Thanks in advance for any help! (4 Replies)
Discussion started by: entropy1980
4 Replies

3. UNIX for Dummies Questions & Answers

How does IRC obtain the users in a channel?

I'm on an IRC server where the command /names is not a valid command. However, on programs like mIRC and Mibbit, the users in the channel still show up on the GUI where it displays the channel users. What command is being used to obtain the user list? (2 Replies)
Discussion started by: daigo
2 Replies

4. UNIX for Dummies Questions & Answers

Users list

Hi i would like to know were the folder that contain file with list of all users ? And were i can learn about what kind of folder i have and wheat they have inside? question 2. when i write ls -a i see all directories and then i choose for example Documents and inside Documents i typed again... (1 Reply)
Discussion started by: iliya24
1 Replies

5. UNIX for Advanced & Expert Users

list of users

Hello!Does anybody know how to solve this script: ,,write a shell script which displays a list of names of users who have created files "*. c" in the last day."? (1 Reply)
Discussion started by: theodoraa
1 Replies

6. Shell Programming and Scripting

IF $USER is not in this list of users, then do this

I need to add to a BASH script if ${USER} is not in a list of users (smitha, brownd, adamsp) then do something... what is the best shortest way to accomplish an if statement with a list like this? Also the list of users should be in the script, not an external file. Thanks! (5 Replies)
Discussion started by: glev2005
5 Replies

7. Programming

to obtain users of each group in c

Hello They have ordered to me that makes several small utilities in C/C++ for the servants, among them a small program in C/C++ to generate a file HTML with the groups of that servant and in addition that is the corresponding users of that group. For example of a group: Group: Sys Members:... (2 Replies)
Discussion started by: cybermeis
2 Replies

8. UNIX for Dummies Questions & Answers

How to obtain list of object files in a shared (dynamic) library?

How can I simply obtain a list of the object files in a shared (dynamic) library. I am looking for the equivalent of "ar -t <lib>" for archived (static) libraries. Thanks in advance. :rolleyes: ---------- Post updated at 01:47 PM ---------- Previous update was at 12:16 PM ---------- The... (1 Reply)
Discussion started by: chatieremerrill
1 Replies

9. Programming

Get the list of logged in users

How can I get the list of logged in users in the system programmatically? I can get the list with 'who' or 'users' commands but I need to get the list programmatically... May someone help, please? Thanks in advance. (2 Replies)
Discussion started by: xyzt
2 Replies
Login or Register to Ask a Question