Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Greetings,
In regards to this question, I'm curious about something.
cat /etc/passwd |grep "/bin/bash" |grep "[5-9][0-9][0-9]" |cut -d: -f1
This would list all users who are added to the system...How to modify it to make it look like it's an entry of /etc/aliases ? I mean how to add the results in the format of this, "allusers: user1, user2, user3, user4" ? Can anyone help?
The last output shows the real users who were added using adduser. I just wanna furnish it to add it to /etc/aliases so that sending email to one alias sends mail to everyone.
On my system I get all users with IDs greater 500 with both
methods ... no idea how you have set-up your passwd file,
and why the shell should make a difference.
That aside: if you take your method to a distro where new users
start with 1000 you won't get any sensible output.
If the shell was important it could easily be added to the awk.
Another question I would like ask is that is it possible to add several users by reading from a text file ? As for example, there are 20 users listed in the file users.txt. If they're to be added in the system using the useradd command, is it possible to do so using useradd, like the example u stated lists all users having UID > 500 in one single line? Thanks in advance.
lsuser -R LDAP ALL would list all userids from the LDAP security registry. lsuser ALL would list all userids from both the local ("files") and LDAP security registries (plus any other security registries defined to the system).
Thanks.
I'll look into the getent command. Hopefully it has an option to retrieve security information from multiple security files like the AIX lsuser command.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.