7 ms·
Show HN: Get help on any Linux command by typing 'howdoi –' in your terminal
- obviyus 6y agoLooks great! This coupled with tldr would prove incredibly useful for some of my friends trying to get used to Linux.
- superasn 6y agoThank you so much. It was inspired by cheat.sh which does something similar too
- superasn 6y agoHi HN, 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 interrupted
- jfim 6y agoThere's another 'howdoi' already, FYI: https://github.com/gleitz/howdoi https://github.com/gleitz/howdoi
- findjashua 6y agoOn OSX, the "StackExchange Search" workflow for Alfred is also fantastic for doing this. 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) https://github.com/deanishe/alfred-stackoverflow https://github.com/deanishe/alfred-stackoverflow
- johnklos 6y agoNo source, huh? And all the world's an x86, I suppose. Why would anyone want to put a closed binary on their systems?
- superasn 6y agoNot sure what you mean. Its a simple script. You can view the source on github.
- vengefulduck 6y agoIt looks like a shell script have you actually opened the file?
- 2fast4you 6y agoIt’s PHP, you can just open it
- maxmalysh 6y ago$ curl cheat.sh/tar $ curl cheat.sh/ssh $ curl cheat.sh/awk
- hivacruz 6y agoI made a small function to use "cheat" and it helps a lot to find examples of how to use some Linux command when I'm stuck: function cheat() { curl cht.sh/$1 }
- rosstex 6y agobash-3.2$ howdoi "delete my root directory? Hypothetically speaking of course"
- saagarjha 6y agobash-3.2$ $(howdoi "delete my root directory? Hypothetically speaking of course")
- filterfish 6y agoDo it, do it! Though I think you need sudo in front of it :-)
- Mizza 6y agoThere's already a popular `howdoi` that me and a buddy made: https://github.com/gleitz/howdoi https://github.com/gleitz/howdoi
- the_pwner224 6y agoThanks. It works for 'get epoch time' which means it'll get added to my system :)
- mulholio 6y agoCame here to comment on how good this one was, thinking this was what the post was about. 10/10 work on this project, never ceases to amaze me and my coworkers.
- gitgud 6y agoThat project looks exactly the same, is this a complete rip-off or coincidence?...
- mellosouls 6y agoI don't think that's fair - it uses the same name and idea, both of which are pretty obvious if you were going to write one yourself but is implemented in a different language and as more of a hack. 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.
- superasn 6y agoNo man. Never even heard of the other one until 20 hours ago. 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.
- gitgud 6y ago
- stephenr 6y agoThis would be good if.. you know.. `man` didn't exist.
- Gaelan 6y agoMan is a terrible tool for quickly remembering how to do something I do once in a while. The examples—usually the most important part—are usually at the very bottom, if they’re even there.
- Fragoel2 6y agoAgree, for this very reason I found tldr to be very useful (https://github.com/tldr-pages/tldr https://github.com/tldr-pages/tldr)
- stephenr 6y agoIf you know something is at the bottom of the output, Shift-G is your friend. I also tend to believe that if you read the options enough you'll be more likely to remember it.
- filterfish 6y agoI use man all the time for exactly this. In fact it is something man really excels at. 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!
- thiht 6y agoThat's not the same use case. Man is good when you know the command to use but not how. Here the use case is when you know what you want to do but not how.
- qznc 6y agoCloser is `apropos` which uses an index of installed man pages.
- rambojazz 6y agoWhere is the information/data retrieved from?
- superasn 6y agoIt searches google and prioritizes results from askubuntu, stackexchange and stackoverflow
- sfj 6y agoInstead of this, I keep a permanent log of every shell command I ever typed and have a handy alias to keep through it. 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.
- Jaxkr 6y agoHow do I get this?
- mic47 6y agoI have similar setup (infinite history, remember directory, shell session, ...), and then ctrl-r runs fzf that find the command first in this session, then in the same directory, then in the rest. I already hinted about that setup here: https://news.ycombinator.com/item?id=22504950 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.
- rhaps0dy 6y agoJust put: 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.
- vardump 6y agoThere are several past posts with same bash one liner. For example https://news.ycombinator.com/item?id=14108671 https://news.ycombinator.com/item?id=14108671
- thiht 6y agoI remember there was the `apropos` command for this use case but I don't think the results were good enough. It might be worth the comparison in your readme though. Anyway when I started using Linux I would have loved something like this.
- filterfish 6y agoI use `man -k` (which is the same thing) all the time. It has a slightly different use case though.
- kjs3 6y agoThose were the two I immediately thought of as well.
- Lurkars 6y agoI didn't try it, but shouldn't PHP be stated as dependency? It's a PHP script and won't run without PHP installed.
- superasn 6y agoYes, I've updated the readme file.
- traviscj 6y agoI use the gleitz version with ``` alias h3='howdoi -n 3' ``` _really_ frequently, because often the top answer wasn't what I needed.
- zneveu 6y ago`alias howdoi="man" `
- deleted 6y ago[deleted]
- jonwhittlestone 6y agoI am a big fan of cheat.sh for which only curl is needed Type in your terminal .. curl cheat.sh/ls
- mellosouls 6y agoYeah, I have this it's excellent, tho sometimes turns my terminal a funny colour...
- gitgud 6y agoReminds me of the tool "tldr" https://github.com/tldr-pages/tldr-node-client https://github.com/tldr-pages/tldr-node-client Let's you lookup easy to read Docs of any Linux command.
- peter_d_sherman 6y agoHello San Kumar! I looked at your source code, I was amazed that it was only one file, and only 100 lines of source code (less if we subtract whitespace). The less source code a program has while still maintaining functionality and being readable, the better. Which brings me to my next point, functionality. 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.
- superasn 6y agoHi Peter. Thank you so much for your nice comment. It just made my day. I truly appreciate your kind words and it really wants me to make more of such things :) 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
- peter_d_sherman 6y agoSure! Why not? I'm nobody important -- but you're more than welcome to use my comment! Wishing you and your project well, -Peter
- butz 6y agoWhat is the most harmless question that might result in rm -rf ?
- sebelk 6y agoNice, just a question, What's the difference with the homonymous app writen in python ?