Get Examples for Bash Commands in Your Terminal
This one is by the great shell-fu, a website with many bash examples.
The following script is a powerful enhancement for the bash experience, and a great addition to the manpages, it allows you to query shell-fu for examples about almost any bash command you might want to use.
The following code is by shell-fu and is available here.
In order for this to work, you’ll need to have “lynx” – the command-line web browser. You can install it in Ubuntu with this command:
sudo apt-get install lynx
Here is the code:
Open a new file and type this:
1
2
3
4 #!/bin/bash
lynx -width=$COLUMNS -nonumbers -dump "http://www.shell-fu.org/lister.php?tag=$1" | \
sed -n '/^[a-zA-Z]/,$p' | egrep -v '^http|^javas|View Comm|HIDE|] \+|to Share|^ +\*|^ +[HV][a-z]* l|^ .*efu.*ep.*!$' | \
sed -e '/^ *__*/N;s/\n$//g' | \less -rX;
Save the file as sheg (or any other name, sheg stands for shell examples)
Now make the script executable:
chmod +x sheg
Now move the file to /usr/local/bin
That’s it, you can use the script like this:
sheg bc
Or
sheg sed
Enjoy
Related posts:
4 Comments to Get Examples for Bash Commands in Your Terminal
Leave a Reply
About Me
Tags
My Twitter
Categories
- Algorithms
- Bash
- BlackBerry
- Collaboration
- Command Line
- Cool Tricks
- Easter Eggs
- Ebooks
- Firefox
- Hardware
- Humor
- Linux
- Linux Development
- Linux Kernel
- Networks
- Open Knowledge
- Other
- Productivity
- Programming
- Science
- Security
- Shell Scripts
- Short Posts
- Thoughts
- Tools
- Vim
- Web Development
- Websites
Popular Posts
Archives
- March 2010 (1)
- January 2010 (1)
- December 2009 (2)
- September 2009 (13)
- July 2009 (1)
- June 2009 (6)
- May 2009 (4)
- March 2009 (18)
- February 2009 (10)
- January 2009 (10)
- December 2008 (7)
- November 2008 (8)
- October 2008 (1)
- August 2008 (1)
- July 2008 (1)
- June 2008 (2)

Nice one. useful link and script, thanks.
I have some bash scripting work on my blog http://unstableme.blogspot.com. you might like it.
Thank you Jadu for the comment, I like the design of your blog. Will have a small journey there
BTW, for the next time, prefix your url with http:// so it gets linkified (I already fixed it for you)
Very nice tip, this one will come in handy quite a bit.
Hey Billy,
Thanks for your comment. And good work in your website (I’m far from being a gamer though)