TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Explain Shell

775 pointsby aleemabout 8 years ago

36 comments

sjrdabout 8 years ago
<i>Very</i> nice! I fed it one of my favorite commands:<p><pre><code> git branch --merged | grep -v master | xargs -n 1 git branch -d </code></pre> and it dealt with it reasonably well. The only part it couldn&#x27;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.
评论 #13989902 未加载
评论 #13989996 未加载
zufallsheldabout 8 years ago
Best used in combination with shellcheck (<a href="https:&#x2F;&#x2F;www.shellcheck.net&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.shellcheck.net&#x2F;</a>), which checks your shell scripts for bugs.
bradbeattieabout 8 years ago
I fed it the most recent command posted on commandlinefu.com:<p><pre><code> grep -i s2enc &#x2F;etc&#x2F;vcac&#x2F;server.xml | sed -e &#x27;s&#x2F;.* password=\&quot;\([^\&quot;]*\)\&quot;.*&#x2F;\1&#x2F;&#x27; | xargs -n 1 vcac-config prop-util -d --p 2&gt;&#x2F;dev&#x2F;null; echo </code></pre> 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?
评论 #13992546 未加载
dangabout 8 years ago
Two big threads from 2013:<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=6296634" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=6296634</a><p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=6834791" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=6834791</a>
评论 #13991055 未加载
The_Hoffabout 8 years ago
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&#x27;t occur).
评论 #13990753 未加载
评论 #13990779 未加载
dwpdwpdwpdwpdwpabout 8 years ago
Quite Nice. Just FYI, the very first command, :(){ :|:&amp; };: is a fork bomb and you probably shouldn&#x27;t run it in your shell
评论 #13993998 未加载
评论 #13994917 未加载
tmerrabout 8 years ago
This works well, but the web interface seems like an unnecessary layer on top of what could just be a terminal based tool. I&#x27;m trying to resist the urge to fork this, putting another project on my todo list I will never finish
评论 #13991610 未加载
评论 #13994923 未加载
mabynogyabout 8 years ago
Optenum to enrich the database of arguments:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;mattboyer&#x2F;optenum" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;mattboyer&#x2F;optenum</a>
评论 #13993691 未加载
评论 #13989682 未加载
fbis251about 8 years ago
Does anyone know where I can find a completely offline tool that does what this site does?<p>The source for this seems like a bit of overkill. I&#x27;d like to be able to use a cli based tool that shows me relevant man sections for the flags I chose for example
TeMPOraLabout 8 years ago
Lovely! Bookmarking for future use!<p>Some quick notes on my way back from work:<p>1. Broken on mobile :(. Default layout is a mess, and &quot;request desktop site&quot; has the lines going to the edge of the screen, making them invisible. S7, Android, Firefox.<p>2. Totally neeeds to be done as an Emacs mode (preferably offline). Both for checking a particular command and during writing shell scripts.
tdrdabout 8 years ago
Really solid. I fed it a recent nasty line from our Makefile: <a href="https:&#x2F;&#x2F;github.com&#x2F;cockroachdb&#x2F;cockroach&#x2F;blob&#x2F;4aeef50&#x2F;build&#x2F;protobuf.mk#L132" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;cockroachdb&#x2F;cockroach&#x2F;blob&#x2F;4aeef50&#x2F;build&#x2F;...</a><p>Looks like it doesn&#x27;t deal with subshells, but otherwise it did reasonably well.<p><a href="http:&#x2F;&#x2F;explainshell.com&#x2F;explain?cmd=find+.+-name+*.pb.cc+%7C+sed+%27s%21.%2F%21%21%27+%7C+xargs+-I+%25+sh+-c+%27echo+%22%23include+%5C%22%25%5C%22%22+%3E+%24%28echo+%25+%7C+tr+%2F+_%29%27" rel="nofollow">http:&#x2F;&#x2F;explainshell.com&#x2F;explain?cmd=find+.+-name+*.pb.cc+%7C...</a>
btschaeggabout 8 years ago
Very impressive.<p>It seems to rely strongly on common *NIX CLI patterns though. It really doesn&#x27;t like dd, for example[1].<p>[1]: <a href="http:&#x2F;&#x2F;explainshell.com&#x2F;explain?cmd=dd+if%3D%2Fdev%2Fsda+of%3D%2Fdev%2Fsdb" rel="nofollow">http:&#x2F;&#x2F;explainshell.com&#x2F;explain?cmd=dd+if%3D%2Fdev%2Fsda+of%...</a><p>Edit:<p>Also, it doesn&#x27;t understand that the token after `-p` for netcat is actually the port argument[2]. I guess it is parsing manpages internally?<p>[2]: <a href="http:&#x2F;&#x2F;explainshell.com&#x2F;explain?cmd=nc+127.0.0.1+-p+80" rel="nofollow">http:&#x2F;&#x2F;explainshell.com&#x2F;explain?cmd=nc+127.0.0.1+-p+80</a>
评论 #13991209 未加载
frankhorriganabout 8 years ago
I&#x27;m not saying that this _is_ a phishing scam. But if it is, hoo boy it&#x27;s a clever one.
评论 #13992312 未加载
kevincoxabout 8 years ago
Cool tool. I think what would really be the icing on the cake is if it substitued the actual command into the documentation. Removing that one layer of indirection would make it that much easier to understand.<p>For example:<p>foo() { bar }<p>&gt; This defines a function named &quot;foo&quot;.<p>Also that example fails to parse. Even though :() { :|: };: works so it seems like there is a certian amount of special casing.
评论 #13991540 未加载
augusttabout 8 years ago
Very cool! Although it has some problems if there isn&#x27;t a space between a flag and its value: <a href="http:&#x2F;&#x2F;explainshell.com&#x2F;explain?cmd=gcc+-I%2Fusr%2Flocal%2Finclude+-L%2Fusers%2Fblah%2Flibs+test.c+-o+bin%2Fprogram" rel="nofollow">http:&#x2F;&#x2F;explainshell.com&#x2F;explain?cmd=gcc+-I%2Fusr%2Flocal%2Fi...</a>
cheezeabout 8 years ago
Pretty awesome, but broke on the first command I tried (granted, it is bash specific IIRC)<p>echo $(( 1 + 2 ))
评论 #13990329 未加载
评论 #13989970 未加载
danellisabout 8 years ago
If you hover over something that points to a description that&#x27;s not currently in view, you can&#x27;t scroll to the description without unhovering and hence unhighlighting the line pointing to the right description.
评论 #13991148 未加载
JasonSageabout 8 years ago
There are several commands on OS X that behave a bit differently from their traditional UNIX counterparts. grep is the big one that springs to mind—any given grep shell-fu may just not work on OS X and I&#x27;ll find myself having to reconstruct the arguments from scratch to get it working.<p>I&#x27;d love to see a fork of explainshell or an option in the interface to deal with items like this which are specific to OS X. Let me put a grep command in for OS X and have it show me what options I&#x27;m using which are undocumented—that would be nifty.
评论 #13992310 未加载
评论 #13997648 未加载
alpbabout 8 years ago
Has anyone been able to get [ or [[ to work here?
评论 #13991097 未加载
abraves10001about 8 years ago
As a relatively new programmer and one who went to one of those mediocre bootcamps, resources like this are invaluable. Thanks!
scott_karanaabout 8 years ago
<p><pre><code> file=$(echo `basename &quot;$file&quot;`) </code></pre> This is a horrible example, since it has a &quot;useless use of echo&quot;, forcing nested evaluations and a bashism. Basename prints to stdout too!<p>The sh-compatible, simpler equivalent:<p><pre><code> file=`basename &quot;$file&quot;`</code></pre>
评论 #13997437 未加载
tuxxyabout 8 years ago
It doesn&#x27;t quite get dd, as well.<p><a href="http:&#x2F;&#x2F;explainshell.com&#x2F;explain?cmd=dd+if%3D%2Fdev%2Furandom+of%3Dtest.iso+bs%3D10M+count%3D10" rel="nofollow">http:&#x2F;&#x2F;explainshell.com&#x2F;explain?cmd=dd+if%3D%2Fdev%2Furandom...</a>
评论 #13989958 未加载
captaincrunchabout 8 years ago
Pretty sweet! It&#x27;s not explaining the &#x27;u&#x27; in: netstat -tulpn though :O
rohit33about 8 years ago
Does well, but goes only so far. I fed the command sudo chown -R $USER:$USER &#x2F;var&#x2F;www&#x2F;example.com&#x2F;html and the tool wasn&#x27;t capable of recognizing what $USER:$USER is doing.
transposedabout 8 years ago
I thought this was pretty cool but missing something. Until I realized that uMatrix was blocking Cloudflare. Once I loaded the rest of the site... Awesomeness. Great work, whoever made this.
elmigrantoabout 8 years ago
Pretty neat! Though it would be nice if it brought into the view the part you highlight when it doesn&#x27;t fit on screen, otherwise you have to scroll (and highlight is lost).
nevsterabout 8 years ago
Handy tip for those on a mac using terminal - type a command and press cmd-ctrl-shift-? to get a man page pop-up. (People with touch bars can just tap on the man page icon.)
israrkhanabout 8 years ago
Very nice. However I find myself trying to decipher regular expressions more often than shell commands. A tool like this for regular expressions would have been more useful.
评论 #13993742 未加载
holtalanmabout 8 years ago
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.
mtryczabout 8 years ago
I totally love this, expecially for learning other peoples code and habits.<p>If it only had a CLI so that I could use it directly from my terminal...
IAmGraydonabout 8 years ago
Even though I&#x27;m fairly experienced in bash, this is the ultimate cheat sheet we all need. Thank you!
twistedpairabout 8 years ago
Too bad, I hoped this was a shell util like EXPLAIN in SQL.<p>e.g. <i>explain cat foo.txt &gt; out.txt</i>
评论 #13990752 未加载
finnhabout 8 years ago
it does a pretty good job with &quot;sudo make me a sandwich&quot; =)<p><a href="http:&#x2F;&#x2F;explainshell.com&#x2F;explain?cmd=sudo+make+me+a+sandwich" rel="nofollow">http:&#x2F;&#x2F;explainshell.com&#x2F;explain?cmd=sudo+make+me+a+sandwich</a>
tambourine_manabout 8 years ago
Nice work, could have a better mobile layout, though
rmistabout 8 years ago
rtfm
electricEmuabout 8 years ago
There&#x27;s no PowerShell support. That&#x27;s not any command.<p><a href="http:&#x2F;&#x2F;explainshell.com&#x2F;explain?cmd=Get-ChildItem" rel="nofollow">http:&#x2F;&#x2F;explainshell.com&#x2F;explain?cmd=Get-ChildItem</a>
评论 #13989749 未加载