4

In Microsoft Windows, when you are open File Explorer at a specific path, you can press Ctrl+N to open another file explorer in the same path. But in Ubuntu when I try Ctrl+N it opens Home Folder. How I can duplicate the same file browser window? (I use Ubuntu 14.04)

  • You can use right click menu by hovering on the tab - Open in a New Window. – Muzaffar Mar 21 '16 at 4:09
  • Perhaps this might help: askubuntu.com/q/507953/57576 – andrew.46 Mar 21 '16 at 8:05
  • thunar file browser provide such option with same shortcut (installed by default for Xubuntu) I expect you are looking for the feature with Ubuntu/Unity/Nautilus, right? – user.dz Nov 27 '16 at 11:49
  • @user.dz I tested thunar and it was that. But I thought I can add that functionality to native file browser. Do you have any Idea in about that? – hasanghaforian Nov 27 '16 at 15:55
  • @JacobVlijm OK! Thank you for your efforts ... – hasanghaforian Nov 27 '16 at 16:16
2

If you don't mind using right-click on any of the files in the directory instead of a keyboard shortcut, it can be done easily.

How to setup

  1. Create, if it doesn't exist yet, the directory ~/.local/share/nautilus/scripts
  2. Copy the script below into an empty file, save it as new_window_here (no extension in ~/.local/share/nautilus/scripts, and Make the script executable
  3. Log out and back in. That's it. Now whenever you right-click on (any) file in a directory, choose Scripts > new_window_here, another window pops up in the same directory:

The script

#!/usr/bin/env python3
import subprocess
import os

def replace(path):
    for c in [("%23", "#"), ("%5D", "]"), ("%5E", "^"),
              ("file://", ""), ("%20", " ")]:
        path = path.replace(c[0], c[1])
    return path

def get(command):
    try:
        return subprocess.check_output(command).decode("utf-8").strip()
    except subprocess.CalledProcessError:
        pass

# get the current path
current = replace(os.getenv("NAUTILUS_SCRIPT_CURRENT_URI"))
dr = os.path.realpath(current)
# call the window
subprocess.call(["nautilus", "--new-window", dr])


Right-click any file > Scripts > new_window_here

enter image description here

...to open a new nautilus window in the same directory.

enter image description here

| improve this answer | |
  • @hasanghaforian great! You're welcome. – Jacob Vlijm Nov 27 '16 at 19:32
3
  • Another option: (Shortcut+Drag)

    1. Ctrl+T to open new tab in same folder
    2. Drag it out

    enter image description here

  • Still another way: (2 Clicks)

    In the header bar: Right Click on current folder → Open in New Window

| improve this answer | |
  • Thank you! I did not know we can open tabs in nautilus! – hasanghaforian Nov 28 '16 at 9:14
  • @hasanghaforian, so you are windows user generally? Most programs that opened much provide tabs, most file/web browsers, terminal emulators, remote clients (rdp, vnc ssh...), text editors ... I added another way (two clicks) – user.dz Nov 28 '16 at 9:38

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.