commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
Searches Google, but requires no "", and will also search all terms input in the CL, eg:
> google foo bar
returns search URL "
You could also use awk to replace all spaces with a +, which is how the Google search handles spaces, but that makes it more than one line.
There are 5 alternatives - vote for the best!
google query_with_spaces "
so, make sure to end your query with a double quote
if [ -n "$1" ]
Ive aliased this script as 'google' on my system and I can type 'google "search terms"' to open firefox with my search terms. My first post here, if there are any improvements to be made please let me know in the comments.
If you can do better, submit your command here.
You must be signed in to comment.