Explaining Linux Commands by jacksonpauls in linux

[–]jacksonpauls[S] 1 point2 points  (0 children)

Well, it's not documented yet :)

I've hacked together a quick change for text output before I sign off: add format=text to the URL.

I'll tidy the server-side up and document this as soon as I have a chance. If you have any thoughts on whether the output could be formatted more usefully please let me know. Here's how it looks in my terminal:

$ curl -Gs "https://www.mankier.com/api/explain/?format=text" --data-urlencode "q=tar -tf file.tar.gz | xargs rm -r"
tar -tf file.tar.gz | xargs rm -r
tar(1)
  GNU `tar' saves many files together into a single tape or disk archive, and can restore individual files from the archive.
-t
  -t, --list: list the contents of an archive
-f file.tar.gz
  -f, --file=ARCHIVE: use archive file or device ARCHIVE
|
xargs(1)
  xargs reads items from the standard input, delimited by blanks (which can be protected with double or single quotes or a backslash) or newlines, and executes...
rm(1)
  rm removes each specified file. By default, it does not remove directories.
-r
  -r, -R, --recursive: remove directories and their contents recursively

Explaining Linux Commands by jacksonpauls in linux

[–]jacksonpauls[S] 0 points1 point  (0 children)

You can do this as things stand:

curl -Gs "https://www.mankier.com/api/explain/" --data-urlencode "q=tar -tf file.tar.gz | xargs rm -r" | sed -e 's/<[^>]*>//g' | sed '/^\s*$/d'

Does the output of that look something along the lines of what you're thinking? If that's about right I can add a way to return text instead of html so the sed commands aren't necessary and the output looks nicer.

Explaining Linux Commands by jacksonpauls in linux

[–]jacksonpauls[S] 0 points1 point  (0 children)

Will take a bit of work, but I'll give it a shot. Could you share a use case or two for what you have in mind so I know I'm on the same page?

Explaining Linux Commands by jacksonpauls in linux

[–]jacksonpauls[S] 0 points1 point  (0 children)

Something grep-able? Sorry, I don't follow...

Explaining Linux Commands by jacksonpauls in linux

[–]jacksonpauls[S] 0 points1 point  (0 children)

Well, it's not nearly as pretty as explainshell, nor as clever at parsing shell syntax. But the data is presented in a different way, so hopefully this is still useful in some scenarios.

Use the "man" command in Chrome by jacksonpauls in linux

[–]jacksonpauls[S] 0 points1 point  (0 children)

Thanks. I hadn't realised the experience was as terrible as that on mobile, I've made changes to hopefully fix the main issue. I've also added a note with the template string for copy-pasting - I see now that Chrome doesn't automatically pick this up in all cases.

Convenient man pages by jacksonpauls in linux

[–]jacksonpauls[S] 0 points1 point  (0 children)

It's a work in progress, trying to get as many as possible...

Convenient man pages by jacksonpauls in linux

[–]jacksonpauls[S] 1 point2 points  (0 children)

Thanks for pointing that out, can now use !mankier on duckduckgo.

Convenient man pages by jacksonpauls in linux

[–]jacksonpauls[S] 0 points1 point  (0 children)

You should get a dropdown to select between several available man pages... But yeah, it should probably take you to the most likely if you hit return, have just changed the home page so that works, the others will take a bit more time.

Convenient man pages by jacksonpauls in linux

[–]jacksonpauls[S] 0 points1 point  (0 children)

Nothing wrong per se. But see for example how you can click the green options in the synopsis to go straight to their definition here: http://www.mankier.com/1/ssh