The pampas of ennui

Being Leonardo Boiko's online Journal, featuring Long & Very Sporadic Essays on any Subject.

Linux commands I wish I had known earlier

29 February 2012

  • 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/passwd or /etc/group, but again, it uses system hooks to ldap and the like.
  • GNU 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.
  • Install 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).

Leave a comment

Leave a Reply

Required fields are marked *