Is it possible to search the internet from the terminal? For instance, could I write some command followed by say https://github.com and it will automatically open a browser with that site through the http protocol?
You could use the /usr/bin/open
command to open websites from the command line.
Simply entering open http://www.github.com
would open GitHub in your default browser.
You can further specify which browser you would like to use, if perhaps it’s not the default one, by using the -a
switch for the open
command. For example, open -a "Safari" http://www.github.com
would open GitHub in Safari even if your default browser is set to Chrome.
The open
command is very powerful and can be used to launch all finds of stuff from the command line. I have an alias set to open Finder in whatever folder I pass as a parameter, so that when I type f .
, it opens Finder in whatever directory I’m working in in Terminal. You could do the same with Google, with a bit of creativity, and pass on your search parameters from the command line. You can also use it to open documents in specific applications, or simply to start an application by typing open -a "Preview"
for example.
You can also browse the internet from within the terminal with browsers like Lynx (https://lynx.browser.org/), but from your question I'm not sure if this is what you want.
Lynx is commonly available for linux systems, and a quick google finds Lynxlet for Mac systems as well (https://habilis.net/lynxlet/).
Once installed, your command would be something like:
open -a Lynxlet https://github.com/
open "http://google.com/search?q=Cody Rutscher"
however, there are third-party command line utilities that can also preform an Internet search base on the arguments passed. What is it you're actually looking for? – user3439894 Aug 19 '18 at 14:54