News for hackers. Stuff that matters.
Re:Terminals Are Sexy by base698 on Sunday December 02, 2018 @05:42PM (#18585039)
Figure this is a troll post, but I'll bite.

As an example of composability... Say you have an api that returns products, but you want to find out how many have the word aliens: curl # gets the api responses grep # searches input wc # counts input. jq # parse and query json

Streaming those together:

  curl api.myapi.com/products | jq .name | grep 'aliens' | wc -l
You have your answer quickly without thinking (after you know all this cold).

Most of the commands are also mnemonic -r is usually reverse, -R recurse, -a all.

I recently in 5 minutes took the API response from one api and constructed sql queries into a test db for test data using roughly the above method. Another fun, trolling type command, a product manager that wanted daily updates got a scrum.sh that ran on cron and posted summary of what people did on slack.

I don't know how you can work effectively as a software engineer without knowing something about it.

There are no comments on this comment yet.