13

Often I would like to open a new terminal in the directory i'm currently working in. E.g. I'm working in ~/some/folder/ and I want to run some program, while at the same time keep a terminal at my disposal in the current directory.

Is there some way I can duplicate the current terminal, by some command or maybe a key combination?

2
25

Press Ctrl + Shift + T

This will open a new tab in GNOME Terminal with same directory(PWD)

Press Ctrl + Shift + N

This will open a new window of GNOME Terminal with same directory(PWD)

2
  • 1
    I was unaware of both commands (and of the tabbed functionality of the terminal as a whole). This works for me, thanks!
    – user717572
    Oct 10 '14 at 12:34
  • This stopped working when I upgrade from Ubuntu 14.04 to 16.04
    – qznc
    Aug 3 '16 at 8:27
4

You can open a second terminal in the same directory using the following command:

nohup gnome-terminal --working-directory $PWD >&/dev/null

And create an alias to quickly get it:

alias dupterm='nohup gnome-terminal --working-directory $PWD >&/dev/null'

You can have the same result with the following keyboard shortcut: Ctrl + Shift + n

6
  • This creates bogus nohub.out files in the current directory whenever you launch it.
    – jmiserez
    Oct 9 '14 at 12:15
  • @jmiserez: I fixed the nohup.out issue. But I disagree, it does not block the current terminal, both are still usable Oct 9 '14 at 12:20
  • Try running it from e.g. terminator. But I'll give you that it does work now, and it doesn't use keyboard shortcuts which could be nice.
    – jmiserez
    Oct 9 '14 at 12:21
  • @jmiserez the context is different from OP, try nohup gnome-terminal --working-directory $PWD >&/dev/null & in your case Oct 9 '14 at 12:23
  • 1
    I removed the downvote and added an upvote. The only advantage over Ctrl-Shift-N here is that you can type it from the terminal, which I have to say is quite nice.
    – jmiserez
    Oct 9 '14 at 12:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.