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)
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
- Create, if it doesn't exist yet, the directory
- 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
- 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:
#!/usr/bin/env python3 import subprocess import os def replace(path): for c in [("%23", "#"), ("%5D", "]"), ("%5E", "^"), ("file://", ""), ("%20", " ")]: path = path.replace(c, c) 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
...to open a new nautilus window in the same directory.