Create a script to open firefox with some google search term from terminal

Just paste the below function inside ~/.bashrc file and then source(source ~/.bashrc) it.

google() {
    search=""
    echo "Googling: $@"
    for term in $@; do
        search="$search%20$term"
    done
    xdg-open "http://www.google.com/search?q=$search"
}

After that you can open google search page directly by google search-string command without pasting the above function everytime on terminal.