Show HN: Get help on any Linux command by typing 'howdoi –' in your terminal
github.com
github.com
You saw a problem, a big problem, which is that often even all of the features Unix has for help (man, apropos, etc.) are not sufficient to be able to quickly figure out how to complete a task, such that frequently people have to Google for answers, and why take the extra steps to go to a different window than the command line, search for answers, and return to the command line?
It's extra steps, but more importantly, it breaks "flow".
Also, this is one of the historic reasons that Unix lost the popularity battle with new/inexperienced users to Windows/Mac -- not enough user-friendly help, and this is especially true of Unix's historic command-line help systems.
So, I applaud the problem you chose to solve, and I applaud the elegant way in which you chose to solve it! You are a true Hacker (used in the positive definition, not the negative)!
So with respect to the problem you chose and the code that solves it, I say to you:
Well played Sir, Well played!
I vote that this code should become a standard part of all Unix distributions from now on.
Edit: I've added your comment to my project's readme file hoping that is okay to do so (let me know if not). Thanks
Wishing you and your project well,
-Peter
The author should tip the hat if it was inspired by the other, but "rip off" is unnecessary.
Having said that, I'm pleased to know about the python original (?), I will give it a whirl.
Also as I replied to another comment this looks for programming related questions while mine is more general linux realted. Also both are free open source software with their source available so feel free to compare before accusing me of making a rip-off.
But, overall I'm quite happy with the response I got here, and I still really wanna make more of such things.
I just find it amazing that you created a very similar tool by the exact same name without realising it "howdoi". However I can understand it.
Funny story, my username "gitgud" was something I chose at random (I think git is good). Turns out there's a reasonably popular project called [1] gitgud, which I didn't event know existed! (so I can understand coincidental name collisions like "howdoi")
> But, overall I'm quite happy with the response I got here, and I still really wanna make more of such things.
You should! these projects are why I come here :)
It also keeps track of the directory a command was run from, so I can limit my search. That way if I ever want to get back into a project I was working on long ago, I can just grep for commands run from that directory.
Not only that, but I can use it to cd to directories quickly. So if I was working under a huge p 10 level deep directory path, I have a alias that will match a string and cd into the last matching path in the permanent history file.
Not only that, but I can also search and then choose and rerun a command in the history, and also edit before rerunning it.
https://news.ycombinator.com/item?id=22504950
Note, that just logging your directory, time and command in text file is great help, since if you don't remember something, you can just open the file and find what you need.
export PROMPT_COMMAND='if [ "$(id -u)" -ne 0 ]; then echo "$(date "+%Y-%m-%d.%H:%M:%S") $(pwd) $(history 1)" >> "${HOME}/bash_logs_$(hostname)/bash-history-$(date "+%Y-%m-%d").log"; fi'
in your ~/.bash_profile. You also may need to `mkdir "${HOME}/bash_logs_$(hostname)"`
I took this command from a Hacker News thread of the past. I don't have a link to it any more.
Made this quick little utility to help you when you forgot to do something in linux terminal, like:
- the arguments for extracting a bz2 file
- the command to reattach to a screen
- the latest ppa for a software program
- to something as simple as which linux distro / version i'm running
The concept is simple. Just download the script and now anytime from your terminal you can write $ howdoi see my linux version
$ howdoi upgrade php
$ howdoi unzip a file
And it will search the internet and try to give you the most relevant search result so that you can do whatever it is you're doing without being interruptedEdit: Though that looks for programming related questions and mine is for more general linux related questions.
inwhichwaymightiaccomplishthefollowinginquiry
But I doubt that would quite catch on.Firstly, you can bind it to a hotkey, so don't have to type "how do i" before the query
Secondly, it updates the list of results as you type. Then you can select the one that seems to be the most relevant to open it in the browser (with a hotkey)
$ curl cheat.sh/tar
$ curl cheat.sh/ssh
$ curl cheat.sh/awkfunction cheat() { curl cht.sh/$1 }
It might be worth the comparison in your readme though.
Anyway when I started using Linux I would have loved something like this.
It has a slightly different use case though.
Type in your terminal ..
curl cheat.sh/ls
I also tend to believe that if you read the options enough you'll be more likely to remember it.
The other nice thing about looking up options in the man pages is that you often see other useful options that you didn't know existed. I've found some of my favourite options this way!
``` alias h3='howdoi -n 3' ```
_really_ frequently, because often the top answer wasn't what I needed.
bash-3.2$ $(howdoi "delete my root directory? Hypothetically speaking of course")https://github.com/tldr-pages/tldr-node-client
Let's you lookup easy to read Docs of any Linux command.