3 ms·
One of the little things that it took me a while to find out about: echo '2^16' | bc 65536 'bc' is a complete calculator language interpreter that also fu
by aarongough 17y ago
One of the little things that it took me a while to find out about:
echo '2^16' | bc
65536
'bc' is a complete calculator language interpreter that also functions quite nicely as a simple calculator. If you need to do any heavy lifting check out:
http://en.wikipedia.org/wiki/Bc_programming_language http://en.wikipedia.org/wiki/Bc_programming_language
- aarongough 17y agoAs a follow-up to that: It might seem basic but understanding pipes (the '|' symbol) is very useful! The pipe symbol 'sends' the output of one command to another. Examples: tail -n 500 log/production.log | less (display the last 500 lines of your production logs one page at a time) cat config/routes.rb | wc (count the number of words and lines in a config file)