Linux commands I wish I had known earlier
shuf. Randomize lines.
shuf -n 1 to get a single random line. Installed by default in most modern distros.
members. Counterpart to
groups; not just a grep to /etc/group, it works with pam, ldap etc. Not installed by default.
getent. Most useful to output data in a format like
/etc/group, but again, it uses system hooks to ldap and the like.
chmod has a capital
X flag (e.g.
chmod a+X or
chmod g-X. It stands for the execute bit, but “only if the file is a directory or already has execute permission for some user”.
ssh-copy-id copies your ssh public key to a remote host, taking care with proper permissions. Installed by default with openssh.
lsb_release gives you details on your distro version, including Debian/Ubuntu release number and codename. Annoyingly, the package name (
lsb-release) differs from the command name.
mii-tool can tell whether an Ethernet link is up, like
ethtool, and comes pre-installed.
molly-guard in all your servers and never
halt the wrong one on ssh again.
uni2ascii is a full-featured tool to transliterate most Unicode characters to ascii (read the manpage).
← Previous Post
Next Post →