r/linuxquestions • • 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.

187 Upvotes

14 comments sorted by

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.

2

u/danitoz Jan 30 '20

1

u/GrowHI Jan 31 '20

Oh wow only 7 days ago too. Sadly it never got far enough up on my feed to see it.

3

u/danitoz Jan 31 '20 edited Jan 31 '20

No worries. The original post was heavily edited, multiple times, before ending like it is right now. The OP was in panic because of the fork bomb and thought viewing the command on the website would execute it on their computer. Huge mess that didn't provide much information on the website and its usefulness. In a way your post was needed to re-establish its creds and have normal discussions about it, so your timing is great!

1

u/[deleted] Jan 31 '20 edited Jan 31 '20

That thread is hilarious.

Sidenote: I was a junior Linux admin on a team that had Macbooks, and if we were having a particularly slow day one of us would throw a file:/// into the dev group chat. Simply viewing that in a chat would actually crash a machine. Fun times.

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"
end

8

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

u/nullol Jan 30 '20

git

the stupid content tracker

lol nice

2

u/GitProphet Jan 31 '20

How dare you?

1

u/nullol Jan 31 '20

he does exist

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

u/mtlabsystems Jan 31 '20

Thanks! It's really a excellent resource.

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...