Skip to content
samirahmed edited this page Mar 12, 2012 · 3 revisions

Fu supports three types of commands...

Searching

Lets say you wanted a quick way to query wikipedia...

$ fu query wikipedia
 1      # Query Wikipedia via console over DNS
        dig +short txt <keyword>.wp.dg.cx

 2	#  Query Wikipedia via console over DNS
	mwiki () { blah=`echo $@ | sed -e 's/ /_/g'`; dig +short txt $blah.wp.dg.cx; }

 3	#  Query Wikipedia via console over DNS
	mwiki() { dig +short txt "$*".wp.dg.cx; }

	447ms total:6

If you are interested in seeing all the results you can type

$ fu -a query wikipedia

If you want to see the first 2 result

$ fu -n 2 query wikipedia

If you want more information about the possible results you can do

$ fu -v query wikipedia
1	#  Query Wikipedia via console over DNS
	dig +short txt <keyword>.wp.dg.cx
	URL:  http://www.commandlinefu.com/commands/view/2829/query-wikipedia-via-console-over-dns
	votes:  153

 2	#  Query Wikipedia via console over DNS
	mwiki () { blah=`echo $@ | sed -e 's/ /_/g'`; dig +short txt $blah.wp.dg.cx; }
	URL:  http://www.commandlinefu.com/commands/view/4591/query-wikipedia-via-console-over-dns
	votes:  5

 3	#  Query Wikipedia via console over DNS
	mwiki() { dig +short txt "$*".wp.dg.cx; }
	URL:  http://www.commandlinefu.com/commands/view/5187/query-wikipedia-via-console-over-dns
	votes:  4

Opening

If you want to learn more about the command you can open the url associated with a given command Let's learn more about search result number 1.

$ fu -o 1                                                        
fu! Opening http://www.commandlinefu.com/commands/view/2829/query-wikipedia-via-console-over-dns

Copying

Result one is one that I am interested so I want to try it out myself, Lets copy it to the clipboard. You can use the -c or --copy commandline flag, but specifying a number after fu will work too!

$ fu 1
fu Copied to Clipboard!
	dig +short txt <keyword>.wp.dg.cx
Clone this wiki locally