michaelmcd's home timeline
Notices
-
The "line" command comes with util-linux on my machine, so I guess some of you may not have that command. Sorry.
-
command line <<<magic # Not that it does much, but this command actually runs without error in BASH at least. ;-)
-
chkconfig --list | grep 3:on # Check what services are setup to start up in run level 3 on a Red Hat based system.
-
sed sentence<<<commented # This is another "alternate demarcation" example that is just a word and produced another word (commenced)
-
sed s/a/emen/<<<dated # That last one may not have been obvious but its basically the same as doing this.
-
sed statement<<<dated # Cool & useful. sed allows you to use other characters to demarcate sections. In this case, 't'. Thx @brimston3
-
http://bit.ly/LNM2Hr # An interesting interview with Stephen Bourne, creator of sh. Great historical insight.
-
I love those interviews, I'm really thankful to computerworkd for doing them.
-
"I have used Bash myself because I run a Linux/Gnu system at home and it appears to do what I would expect." -Steve Bourne #quote
-
Something that crossed my mind while reading about performance in sh, is there a lint-like program for {ba,c,k,z}?sh ?
-
-
"Loose bits sink chips" -fortune
-
echo $(($(ssh REMOTEHOST date +%s) - $(date +%s))) # Tell me how many seconds a server's clock is off compared to localhost. Thx @msquadrat
-
last reboot # See the last several times your system was rebooted. Reboot == that thing you do once in a while for kernel upgrades.
-
@climagic ...unless you have a bill to pay and a desktop computer.
-
-
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
-
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.
-
echo "export LIBOVERLAY_SCROLLBAR=0" >> ~/.xprofile # Logout/Login required. Will give you back your scrollbars in Ubuntu. Thx @rafaelsdm
-
printf "$( cat /sys/class/power_supply/BAT?/{voltage,current}_now) * 10 12 ^ 3 k / p" |dc # Show battery power drain (linux) Thx @telent_net
-
http://ur1.ca/9elqi # CLIMagic 2012 Survey results are out. Everyone is special in some way.
- zinayto repeated this.
-
The reason I do it this way is because the cut command can't be used with 'tail -f' like this due to output buffering issues.
-
In that last one, I needed the $COLUMNS variable from bash, but the $0 from awk, so by using "", I let the $COLUMNS through and backslash ..
-
means that it will pass a literal $ to awk and thus use awk's $0, which means the whole line.
-
tail -f log |awk "{print substr(\$0,0,$COLUMNS)}" # Cut log to width of your term. Note use of quotes. COLUMNS is BASH variable.
-
Happy CLI Day 2012! http://ur1.ca/9eijs
- Carlos Solís likes this.
- Ankur Sinha and Carlos Solís repeated this.
-
Happy CLI Day 2012! http://ur1.ca/9eijs