r/linuxquestions • u/GrowHI • Jan 30 '20
ExplainShell.com is an Awesome Resource
Recently was teaching my students how to get a raspberry pi up and running and they had questions about the console commands we were using. I was doing some googling and found ExplainShell.com which is an amazing tool to view the meaning and inner workings of shell commands. Some pretty complex stuff can be dropped in and a tiered tree shows up explaining each part.
10
u/SleeplessSloth79 Jan 31 '20
I'm using a similar resource from a fish alias, very useful
explain.fish
function explain
if [ (count $argv) -eq 0 ]
read -P "Command: " input
else
set input $argv
end
curl -Gs "https://www.mankier.com/api/explain/?cols=$COLUMNS" --data-urlencode "q=$input"
end8
u/XOKP Jan 31 '20
I rewrote your function for normal bash:
#!/usr/bin/env bash if [[ -z $* ]]; then read -rp "Command: " input else input=$* fi curl -Gs "https://www.mankier.com/api/explain/?cols=$COLUMNS" --data-urlencode "q=$input"
5
5
u/ASIC_SP Jan 31 '20
inspired by this site, I wrote a bash script for man/help page parsing to be used from cli: https://github.com/learnbyexample/command_help
2
u/Disruption0 Jan 30 '20 edited Jan 30 '20
It's necessary to be an absolute dumbass to c/p random command line in any term.
So what's the problem with the bomb?
Edit : typo
1
0
u/Ciefish7 Jan 31 '20
Excellent topic, OP... I found great resources on adafruit for SSH config with encryption. Also details on headless setup. Learned a lot there...
4
u/[deleted] Jan 30 '20
Before this thread falls into "OMG THE FIRST EXAMPLE IS A FORK BOMB! DANGER! DANGER!", it is only parsing text and explaining what is going on.
It is not promising that a command is safe to run on your system simply because it parses its text correctly. A fork bomb is a good example to display its usage, and help others recognize and understand how they work so that they can be avoided.
The last time someone posted about this site, a few people saw the example and pulled the alarm, which quickly turned into a bunch of fear-mongering and others trying to explain its safety and purpose, which totally detracted from the content of the post.