91 comments

[ 3.3 ms ] story [ 158 ms ] thread
There's no PowerShell support. That's not any command.

http://explainshell.com/explain?cmd=Get-ChildItem

I'm confused. Is PowerShell 'recognized' as a shell?

I thought only unix and unix-like shells would be covered. I wonder what the technical definition of a shell is though.

(genuinely curious, not trying to be snarky)

It clearly doesn't cover "unix and unix-like" shells, since fish shell syntax isn't supported. It seems to be trying to be bash-compatible since it uses bashlex under the hood, but as another commented noticed, the bash parsing isn't perfect.
(comment deleted)
>I'm confused. Is PowerShell 'recognized' as a shell?

Yes, given the definiton of shell being a user interface to an operating system, typically command line, powershell is considered a shell and can function as one. For example, while many think of windows servers as being all gui, newer versions of windows (server) can be run entirely in cli mode with no gui via powershell, in which supposedly any management technique normally done through gui can be done through the ps cli.

The main difference between nix shells and powershell is that the nix shells are text based, while powershell is object based due to it's .NET core.

As a sysadmin who uses both bash and powershell, I have to say the more recent versions of powershell are quite powerful and a fresh breath of air to use in the normally stale windows world. Of course, I tend to use pywinrm to remotely run ps commands so I don't too dirty touching the tainted MS ecosystem. (That's my way of saying that while powershell is nice and a large improvement over batch command line files, bash is still the better one due to the underlying unix philosophy and the GNU ecosystem)

It depends who's doing the recognizing. I don't see why it wouldn't. And I'm not sure where you got the idea that it was unix-likes only.
Yes, it is recognized as a shell.

The original description was listed as "explain any shell command". That was an erroneous title that's since been updated.

Pretty awesome, but broke on the first command I tried (granted, it is bash specific IIRC)

echo $(( 1 + 2 ))

not at all a bashism

  $ uname -sr
  OpenBSD 6.0
  $ ps T
    PID TT  STAT       TIME COMMAND
  85828 pc  Ssp     0:00.01 -ksh (ksh)
  34802 pc  R+p     0:00.00 ps -T
  $ echo $(( 1 + 2 ))    
  3
Very nice! I fed it one of my favorite commands:

    git branch --merged | grep -v master | xargs -n 1 git branch -d
and it dealt with it reasonably well. The only part it couldn't understand was `branch -d` at the end. In other words, it was not capable of recognizing that the non-option arguments to `xargs` should actually be recursively interpreted as a command-line.
TIL that git calls itself "the stupid content tracker"
Pretty funny seeing as the main complaint about git is that it's too complex
i discovered this site about two years ago. I still use it for explaining commands that I run across on StackOverflow before I run them in my own terminal.
(comment deleted)
Lovely! Bookmarking for future use!

Some quick notes on my way back from work:

1. Broken on mobile :(. Default layout is a mess, and "request desktop site" has the lines going to the edge of the screen, making them invisible. S7, Android, Firefox.

2. Totally neeeds to be done as an Emacs mode (preferably offline). Both for checking a particular command and during writing shell scripts.

As a relatively new programmer and one who went to one of those mediocre bootcamps, resources like this are invaluable. Thanks!
I fed it the most recent command posted on commandlinefu.com:

    grep -i s2enc /etc/vcac/server.xml | sed -e 's/.* password=\"\([^\"]*\)\".*/\1/' | xargs -n 1 vcac-config prop-util -d --p 2>/dev/null; echo
Given the height of the result, scrolling up and down became a real pain. Maybe collapsable sections or position:fixed for the command or something like that?
The "navigate:" part lets you cycle through 'chunks' of explanations
Even though I'm fairly experienced in bash, this is the ultimate cheat sheet we all need. Thank you!
Pretty neat! Though it would be nice if it brought into the view the part you highlight when it doesn't fit on screen, otherwise you have to scroll (and highlight is lost).
Too bad, I hoped this was a shell util like EXPLAIN in SQL.

e.g. explain cat foo.txt > out.txt

All it needs is an API and you could easily build a tool which does just that.

Though if you wanted it to actually explain `cat foo.txt > out.txt` and not just output the explanation for `cat foo.txt` to `out.txt` you'd probably have to put that in quotes.

Not really need an API to quickly build a tool for this. Could as well just send a proper request and parse the response, not too much of extra work for this service.
(comment deleted)
I would love it if the site was encrypted so that I could input raw commands at work without modifying sensitive information. (Yes I understand the host can still record this sensitive information, and no I have not looked through the source code yet to see that this doesn't occur).
> and no I have not looked through the source code yet to see that this doesn't occur

Still, the website might be running on a modified version.

It doesn't. And I'm not just saying that because there's an agent pointing a gun at me as I type this.

Having said that, please don't send sensitive information to a random service on the internet. :)

No offense, I was just pointing a general fact. =)
Well, it's open-source so I guess you could always self-host.
Wow it's been 4 years?

Would you believe it if I told you it's running on the smallest digital ocean instance, backed by MongoDB (!), and the only time I had to do any maintenance on it was when DO turned down the machine I happened to run on? The service doesn't exactly scream complexity, but it's nice when you put something out there and it just runs!

A quick shout out that I use explain shell in my teaching kids how unix and piping functions work. Cheers man!
I wrote a little shell challenge/tutorial project a little bit ago and was thinking about adapting it to teaching beginners. would love to hear your thoughts -https://cmdchallenge.com
Didn't know about this, thanks for reposting!
I'm not saying that this _is_ a phishing scam. But if it is, hoo boy it's a clever one.
If you hover over something that points to a description that's not currently in view, you can't scroll to the description without unhovering and hence unhighlighting the line pointing to the right description.
How do you mean? Seems to work for me. Please file a bug report with how to reproduce!
Nice work, could have a better mobile layout, though
Pretty sweet! It's not explaining the 'u' in: netstat -tulpn though :O
Very impressive.

It seems to rely strongly on common *NIX CLI patterns though. It really doesn't like dd, for example[1].

[1]: http://explainshell.com/explain?cmd=dd+if%3D%2Fdev%2Fsda+of%...

Edit:

Also, it doesn't understand that the token after `-p` for netcat is actually the port argument[2]. I guess it is parsing manpages internally?

[2]: http://explainshell.com/explain?cmd=nc+127.0.0.1+-p+80

It boils down to a bunch of heuristics so there are gaps if the man page is slightly off of what it expects.