- What command should I type to run Chrome from the terminal?
- 5 Answers 5
- Universal path for Chrome on *nix systems?
- 1 Answer 1
- You must log in to answer this question.
- Related
- Hot Network Questions
- Subscribe to RSS
- How to open Google Chrome from the Terminal in Ubuntu?
- Installing Google Chrome on Ubuntu
- Opening Google Chrome using the Terminal
- Additional comments
- Conclusion
- About the author
- Zeeman Memon
- How to add Chromedriver to PATH in linux?
What command should I type to run Chrome from the terminal?
I have remote box accessed by VNC and jwm desktop.
No menus, not desktop icons, only a terminal window. I have downloaded Chrome’s .deb package and installed it. How can I run it from the terminal window?
You might be interested in this generalised question: How can I know which commands were installed with a package?
What do you mean what command should you run? If you’re vnc’d in, just call the command by the name. If you don’t know the name you can always run x-www-browser and it’ll run the default browser.
5 Answers 5
Well simply typing google-chrome works fine for me. It might not work if you installed Chromium. chromium-browser is for Chromium.
However if it’s a remote box. At least via ssh you must use -X when option connecting to be able to run windowed apps. Like this:
If you get the path where the application is installed then you can run the application from there
For example to know the path where google-chrome is located run this command:
You will get the path like:
google-chrome: /usr/bin/google-chrome /usr/bin/X11/google-chrome /usr/share/man/man1/google-chrome.1
Now you can run chrome by either executing two commands:
/usr/bin/google-chrome /usr/bin/X11/google-chrome
Note: it will be applied for all installed applications. Also, It would be possible that you would not get the path /usr/bin/X11 or would get something different.
Hope you like this way to find the path and run chrome 🙂
Universal path for Chrome on *nix systems?
Is there a more official list somewhere? How is chromedriver doing this same logic does anyone know?
You need to consider two things: how is the binary named, and where is it stored. Currently you only cover the first.
by the way, i’m only looking for the «standard» place they would be found. I don’t have to cover any custom, non-typical scenarios. I’m just trying to do as good of a job as chromedriver does when finding a suitable chrome executable.
1 Answer 1
Chromedriver looks for files in the following locations:
- /usr/local/sbin
- /usr/local/bin
- /usr/sbin
- /usr/bin
- /sbin
- /bin
- /opt/google/chrome
File names that it searches for are:
You must log in to answer this question.
Related
Hot Network Questions
Subscribe to RSS
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.
Site design / logo © 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA . rev 2023.7.17.43537
Linux is a registered trademark of Linus Torvalds. UNIX is a registered trademark of The Open Group.
This site is not affiliated with Linus Torvalds or The Open Group in any way.
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.
How to open Google Chrome from the Terminal in Ubuntu?
Although most versions of Ubuntu come with Mozilla Firefox installed as the default browser, having Google Chrome installed has its fair advantages. Google Chrome has been the superior choice when it comes to browsing on a desktop, having support for most plugins and a variety of add-ons, the likes of which cannot be found on any other browser.
This makes Google Chrome an ideal browser and a must-have no matter which operating system you are running. This guide will help you install Google Chrome on Ubuntu and instructions to use it with the help of the Terminal.
Although this guide is meant for versions of Ubuntu, it should work the same way for any Linux Distribution.
Installing Google Chrome on Ubuntu
There are two methods to install Google Chrome on Ubuntu. One is using the Graphical User Interface (GUI) and the other by using the Linux Terminal. We will first explain the graphical method and briefly examine how to do it from the Command Line Interface (CLI), i.e., the Terminal.
Open Mozilla Firefox and type “Google Chrome” in the search bar or click here.
You should see a chrome window with a “Download Chrome” button, as shown in the image below. Click on the button to download the browser.
You will be given the option to download .deb or .rpm, which has to do with what Linux Distro you are using. Since this article is concerned with Ubuntu, click on the .deb package and press “Accept and Install.”
A download window should appear. Click on Save File and press OK.
Having done that, double-clicking the file, you downloaded should do. A new window will appear that will prompt you to install Google Chrome on your device. Click on “Install”.
Ubuntu will ask you to authorize the installation by entering your account password.
Alternatively, you can also install Chrome through the Terminal. To do this, we must first use a wget command.
This will download the offline installer for the browser.
Next, we install the package with the following dpkg command.
If you get any errors about missing dependencies, run the following command to forcibly install them.
Having successfully installed the Debian package, you are now ready to use Google Chrome.
Opening Google Chrome using the Terminal
Google Chrome, like any other program, can be accessed through its graphical icon. However, those that are fond of using the command-line Terminal to do things are also in luck. We will now show you a way to operate the Chrome browser through the Terminal.
Working on the Terminal allows you to access the browser using a single command. To open Google Chrome with the help of the command line, follow the steps given below:
Go to Desktop > Applications.
Type Terminal in the search bar and click on the first result.
Or you can skip the lengthy process and open a new Terminal session by pressing Ctrl + Alt + T on your keyboard.
To open Google Chrome, type the following in the Terminal:
This will load up Google Chrome with the default homepage.
Google Chrome does not require you to specify any sort of directories as it is mounted in the binary path.
Let’s look at some more ways to use the Google Chrome browser through the Terminal. Let’s say, for instance, that you wish to visit a specific website. You can do this by entering the URL of the website of your choice, as shown in the command below:
Similar to other Terminal commands, you can enter flags and command parameters with the Google Chrome run command to achieve specific tasks. The general syntax of performing this is given below.
Below is a list of flag options that you can use to achieve daily life tasks through the Terminal.
—incognito Opens the browser in incognito mode
—new-window Opens the path or URL specified in a new window
—version Displays the Version Information
—app=URL Used to run URL in app mode, meaning without toolbars.
If you wish to explore your options even further, run the help command given below:
Additional comments
Keep in mind that to run Google Chrome on your Linux system, the computer architecture must be 64-bit.
Once you install Google Chrome the way we showed you in this guide, you also add Google’s repository, which is responsible for keeping the program up-to-date. So, you do not need to worry about updating the browser yourself.
You can find the path where Google Chrome is located by typing the following command:
You should see the path specified as shown in the image below:
You can also close the browser with the help of the Terminal by typing the following command:
Conclusion
With all the steps followed correctly, you are now ready to use Google Chrome on your laptop or desktop computer. Enjoy one of the fastest and most versatile browsers available to you in the present day and age.
We hope this guide helped you understand how to access Google Chrome with the help of Terminal commands. Apart from that, we also included additional information on how to maneuver through the options and URL shortcuts that come with them.
About the author
Zeeman Memon
Hi there! I’m a Software Engineer who loves to write about tech. You can reach out to me on LinkedIn.
How to add Chromedriver to PATH in linux?
You can specify the absolute path to your chrome driver in your script as such:
from selenium import webdriver driver = webdriver.Chrome(executable_path='/path/to/driver/chromedriver')
Or you can add the path to your webdriver in the PATH system variable as so:
export PATH=$PATH:/path/to/driver/chrome-driver
You may add the above line to your /home//.profile file to make it permanent.
Tested on Ubuntu 17.10 running Python 2.7.14
The solution posted by @AnythingIsFine is indeed correct.
However in my case my pytest was still unable to find the chromedriver (despite it was correctly added to the PATH and from the terminal I could execute it).
So I’ve solved by adding an alias of the chromedriver in the /usr/bin directory:
sudo ln -s /path/to/chromedriver /usr/bin
first answer did not take effect. this one did, not sure if it was the combination of both! thanks man!
Move Chromedriver to path with:
sudo mv -f ~/chromedriver /usr/local/bin/chromedriver
/usr/local/bin/chromedriver is path.
For selenium framework (python or java), Browser driver(chrome/firefox/ etc.) should be saved on the Path » /usr/local/bin/chromedriver & /usr/bin/chromedriver»
For Chrome Driver Link : https://chromedriver.chromium.org/downloads go to the link and download the chrome driver for corresponding OS.
Linux: Open the terminal on the Saved/downloaded directory then enter the command
«sudo mv /path/to/chromedriver /usr/bin» «sudo mv /path/to/chromedriver /usr/local/bin»