Get quick answers to common linux related questions, right inside your terminal by typing "howdoi [your question]".
$ howdoi extract a bz2 file
-j, --bzip2
filter the archive through bzip2
tar -xvjf enginsxt.tar.bz2
Source: https://askubuntu.com/questions/707861/how-to-extract-tar-bz2
$ howdoi -v add a program to cron
Put a shell script in one of these folders: /etc/cron.daily, /etc/cron.hourly, /etc/cron.monthly or /etc/cron.weekly.
If these are not enough for you, you can add more specific tasks e.g. twice a month or every 5 minutes. Go to the terminal and type:
crontab -e
...snip
Source: https://askubuntu.com/questions/2368/how-do-i-set-up-a-cron-job
$ howdoi -n 2 attach to a screen
screen
screen -S myprogramrunningunderscreen
screen -ls
There are screens on:
4964.myprogramrunningunderscreen (05/31/2013 09:42:29 PM) (Detached)
4874.pts-1.creeper (05/31/2013 09:39:12 PM) (Detached)
Source: https://askubuntu.com/questions/302662/reattaching-to-an-existing-screen-session
screen -d -r
Source: https://askubuntu.com/questions/302662/reattaching-to-an-existing-screen-session
$ howdoi js hex to int
hexString = yourNumber.toString(16);
yourNumber = parseInt(hexString, 16);
Source: https://stackoverflow.com/questions/57803/how-to-convert-decimal-to-hexadecimal-in-javascript
howdoi [-n -v -h -i] -- question
-n Number of results (default is 1)
-v Show full answer (otherwise shows only code)
-i Interactive or REPL mode (useful for hotkey binding)
-h Shows this help
Just run the following commands (requires PHP 5+).
$ mkdir -p ~/bin && wget https://raw.githubusercontent.com/san-kumar/howdoi/master/howdoi -O ~/bin/howdoi && chmod +x ~/bin/howdoi
$ sudo ln -s ~/bin/howdoi /usr/local/bin/howdoi
$ howdoi check my linux version
It is possible to run this outside the terminal interactively via a hotkey binding. It can also handle simple programming related questions too.
(you can ask questions in a popup too by pressing a hotkey - as described below)
- Copy popup.sh in your
~/bin
folder (or the folder in which you've downloaded howdoi script) - Run
chmod +x ~/bin/popup.sh
- Go to Settings > Keyboard > Shortcuts and add a new shortcut to
~/bin/popup.sh
- Assign a hotkey (e.g. Ctrl+Shift+H) to your new shortcut.
- Now press the hotkey and you should see a popup where you can type your question!
Hopefully it will save you some time and makes your life easier. If so, please share it with your friends and give me feedback here.
Thank you everyone who encouraged me and voted for this project on Hacker news. Seeing comments like these really makes the work I've put into it worth it and now I want to make more such projects!
- It's just a quick hack to save you a few clicks. I wrote this in just a few hours, so it's not perfect.
- Right now, it prefers Ubuntu solutions over other linux distros.
- Just to clarify this only prints the answer, it does not run any code on your machine (in case the screenshot gives you the wrong impression).
Perl's Artistic Licence