2

I want to run a command line that opens a new chrome window with another profile.

I tested the following commands:

Preconditions:

  • I have two profiles: Profile 1 and Profile 2

  • Chrome is already running with Profile 1

google-chrome --profile-directory="Profile 2"

The above command does nothing other than bringing focus to the currently running chrome with Profile 1

I also tried:

google-chrome --profile-directory="Profile 2" --new-window

The effect is the same.

I want to run a command line that opens a new chrome window with Profile 2 while there is already a Chrome window running with Profile 1

1
  • 1
    What are your Ubuntu and Chrome version? On Ubuntu 18.04 with Gnome and Chrome 84.0.4147.89 the command you posted (google-chrome --profile-directory="Profile 2") works fine in doing what you are asking - opening a new Chrom window using Profile 2 (it shows some errors and warning in the terminal, but it works)
    – dadexix86
    Jul 15, 2020 at 23:03

3 Answers 3

2
+50

When adding new profile named Whatever, Chrome does not create profile folder with the same name. Naming convention is "Profile X", where X is integer. So, it may be the case to check the real profile folder name before executing the command.

chrome --profile-directory="Profile folder name" works fine on Ubuntu.

You may also find useful this answer and discussion https://superuser.com/a/377195/1084604

2

Some additional context to qba-dev's answer - can be a gotcha.

At least on my system, profiles actually start with "Default", and then iterate through "Profile X".

So, for original profile

google-chrome --profile-directory="Default" --new-window

For second profile:

google-chrome --profile-directory="Profile 1" --new-window

Etc.

But also be aware the browser GUI muddies the water here in that the first profile Default is labeled "Person 1" in the profiles UI box. The second profile, "Profile 1" is labeled "work" (in my case) in the UI, etc. It is enough to create some confusion.

To further complicate... in my case in $HOME/config/google-chome there are directories: Default, 'Profile 1' and work. I believe the work directory exists from previously trying to call "work" profile from the command line

google-chrome --profile-directory="work" --new-window

Instead of this opening the existing work (Profile 1) profile, it created a third profile, identified with the 'work' directory in the configs folder, but associated to a "Person 2" profile in the UI.

The disconnect between UI & configuration labeling (and the offset in the increment count of profiles) is hopefully something that could potentially be addressed in future releases.

"Default" = "Person 1"

"Profile 1" = "work"

config dirs

"work" = "Person 2"


Chrome Version 88.0.4324.182 (Official Build) (64-bit)

0

It appears that others have already provided solutions to the question. Indeed, you can launch Google Chrome with a specific profile from the command line using the following syntax:

google-chrome --profile-directory="Default"

or

google-chrome --profile-directory="Profile 1"

I tested these commands and they work seamlessly when creating a new profile. However, my scenario involved automating my workspace and opening existing profiles from the terminal, which proved to be a bit challenging. To address this, I delved into the configuration files located in the .config/google-chrome directory in Ubuntu (and likely applicable to most Linux distributions). Within this directory, you'll find numerous folders, including those corresponding to your existing profiles. This aspect can be confusing because in the Chrome GUI, profiles are displayed with user-friendly names such as "Personal" or "Office." In the config directory, however, the profiles are labeled differently; for instance, mine were named "Profile 1" and "Profile 2" (as accurately explained by gskerry).

Allow me to contribute an additional detail: you can identify your profile directory by navigating to chrome://version/ in your desired Chrome profile.

Default Profile

Profile 1

In my case,

  • Profile Path : /home/mh-shifat/.config/google-chrome/Default
  • Profile Path : /home/mh-shifat/.config/google-chrome/Profile 1

Once you determine your profile directory using this method, you can effortlessly launch the desired profile from the terminal using the command:

google-chrome --profile-directory="Profile_Directory"

Thanks.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .