Uses the file located in /etc/services Show Sample Output
getent allows to get the contents of several databases in their native file format even if they are not actually in /etc. For example, if you are using a LDAP or a DB to authenticate your users, you won't find their info by catting /etc/passwd, but "getent passwd" will concatenate /etc/passwd to the LDAP/DB. Show Sample Output
better with accounts on ldap Show Sample Output
has the benefit of being a bit more cross-platform.
I just wanted a simple DNS request. Because host and nslookup commands are not on all systems, we use getent instead. Thanks aulem for that tip.
Alternately for those without getent or only want to work on local users it's even easier:
cut -d: -f1 /etc/passwd|xargs -n1 passwd -e
Note that not all implementations of passwd support -e. On RH it would be passwd -x0 (?) and on Solaris it would be passwd -f.
man 5 shadow
I think it's more reliable, because
passwd -S
dont show "locked" but "L" as second field on my Archlinux for a particular user.
( unixhome alternative ).
If your contact information was entered when your user account was created (it gets added to /etc/passwd) then this gets that info and creates a QR code for you automatically
added echo "### Crontabs for $user ####"; to make clear whose crontab is listed.
See the members of a group
Doesn't require finger and should work whatever the underlying auth mechanism is Show Sample Output
Short and concise output appropiate for scripts. Show Sample Output
get the dns recorded ip adress of the domain Show Sample Output
Don't abuse sudo command! Use superuser as it is supposed to be.
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: