Get short, timely messages from Command Line Magic.

Twitter is a rich source of instantly updated information. It's easy to stay updated on an incredibly wide variety of topics. Join today and follow @climagic.

Get updates via SMS by texting follow climagic to 40404 in the United States
Codes for other countries

Two-way (sending and receiving) short codes:
Country Code For customers of
Australia
  • 0198089488 Telstra
Canada
  • 21212 (any)
United Kingdom
  • 86444 Vodafone, Orange, 3, O2
Indonesia
  • 89887 AXIS, 3, Telkomsel
Ireland
  • 51210 O2
India
  • 53000 Bharti Airtel, Videocon
Jordan
  • 90903 Zain
New Zealand
  • 8987 Vodafone, Telecom NZ
United States
  • 40404 (any)

climagic

  1. The "line" command comes with util-linux on my machine, so I guess some of you may not have that command. Sorry.
  2. command line <<<magic # Not that it does much, but this command actually runs without error in BASH at least. ;-)
  3. chkconfig --list | grep 3:on # Check what services are setup to start up in run level 3 on a Red Hat based system.
  4. sed sentence<<<commented # This is another "alternate demarcation" example that is just a word and produced another word (commenced)
  5. sed s/a/emen/<<<dated # That last one may not have been obvious but its basically the same as doing this.
  6. sed statement<<<dated # Cool & useful. sed allows you to use other characters to demarcate sections. In this case, 't'. Thx @brimston3
  7. bit.ly/LNM2Hr # An interesting interview with Stephen Bourne, creator of sh. Great historical insight.
  8. "Loose bits sink chips" -fortune
  9. @thepez2k6 Cool, that's pretty good on a desktop. I usually have to reboot after 60 days for some reason or other.
  10. @natureshadow Not really, the latency is there either way. If you want accuracy, this isn't the right solution. Use ntp instead.
  11. echo $(($(ssh REMOTEHOST date +%s) - $(date +%s))) # Tell me how many seconds a server's clock is off compared to localhost. Thx @msquadrat
  12. RT @sionide21: date; while ps -p $PID > /dev/null; do sleep 1; done; date # Quick and dirty timing of already started long running process
  13. @cdlegg I think it will give the end time as CRASH if that happens.
  14. last reboot # See the last several times your system was rebooted. Reboot == that thing you do once in a while for kernel upgrades.
  15. @twitlud @MacLemon I'm writing something up that will explain all the software I used and how I processed the results. Give me a few days.
  16. fgrep 28/May/2012 access_log | awk '$1~/\.[a-z][a-z]$/{print $6 " " $7}' # For May 28th, print the req fields for hosts from two letter gTLD
  17. tmux split top # Start "top" in a split window inside your current #tmux session. You can even do this remotely or from the tmux cmd prompt.
  18. echo "export LIBOVERLAY_SCROLLBAR=0" >> ~/.xprofile # Logout/Login required. Will give you back your scrollbars in Ubuntu. Thx @rafaelsdm