Skip to content

Instantly share code, notes, and snippets.

@sanjarcode
Last active May 27, 2023 16:23
Show Gist options
  • Save sanjarcode/e28e6ee2aa1d8d51cd8143f4733fc1c8 to your computer and use it in GitHub Desktop.
Save sanjarcode/e28e6ee2aa1d8d51cd8143f4733fc1c8 to your computer and use it in GitHub Desktop.
Gnome Terminal (the default Ubuntu terminal) tips, quirks

Open a new terminal at given directory

gnome-terminal --working-directory some_path

Note:

  1. this option works only if used before other options, so keep it before.
  2. It doesn't work with relative paths, i.e. .. won't work. This could be solved - StackOverflow

Open a new terminal (as a tab)

gnome-terminal --tab -- bash -c "<my_script or command> exec bash" # syntax

gnome-terminal --tab -- bash -c "echo Hello; exec bash" # example

Note: focus shifts to the new terminal (tab)

Open a terminal (as a new window)

gnome-terminal --window -- bash -c "<my_script or command> exec bash" # syntax

gnome-terminal --window -- bash -c "echo Hello; exec bash" # example

Note: focus shifts to the new terminal (window)

@sanjarcode
Copy link
Author

I need this top open both frontend backend servers of my web apps at the same time, using a single command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment