commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
Short and concise output appropiate for scripts.
Doesn't require finger and should work whatever the underlying auth mechanism is
See the members of a group
added echo "### Crontabs for $user ####"; to make clear whose crontab is listed.
Uses the file located in /etc/services
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
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.
better with accounts on ldap
man 5 shadow
I think it's more reliable, because
dont show "locked" but "L" as second field on my Archlinux for a particular user.
( unixhome alternative ).
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.
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.