Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

I currently use nautilus as my default file manager. When I search for some file or folder, I also need to switch to the directory that contains the particular file or folder. It feels tedious to go to the properties then copy the path and open the same path. How can I save time, could there be some shortcut to switch to the directory that contains the file (or folder) being looked upon.

share|improve this question

marked as duplicate by karel, minerz029, BuZZ-dEE, Jorge Castro, Lucio Feb 14 '14 at 16:27

This question was marked as an exact duplicate of an existing question.

See this – TheKojuEffect Feb 13 '14 at 1:48

I don't know about any inbuilt function that could achieve this, but you could use a simple Nautilus script:


nautilus "$(dirname "$1")"

In fact, you could even direct Nautilus to the file right away and it would still open the parent directory:


nautilus "$1"

With this script Nautilus will also highlight the file within the directory.

See here for more information on installing Nautilus scripts:

How can I install a Nautilus script?

You could then proceed to set up a shortcut for the script. I'd advise you skip step 2 and 4 of that answer as they don't appear to be necessary. If you named your script something like "Open parent directory" it should be easy to find it in the accels file and change the hotkey. The line should look something like this:

(gtk_accel_path "<Actions>/ScriptsGroup/script_file:\\s\\s\\shome\\sshivshnkr\\s.gnome2\\snautilus-scripts\\sOpen%20parent" "F4")

In this case the shortcut would be F4.

share|improve this answer
Because I see that this answer is getting downvoted: You are free to vote without any comment but I'd appreciate it if you could tell me what's wrong so that I can improve my answer. – Glutanimate Feb 13 '14 at 1:36

What method are you using to search? I tried "Search for Files" in Nautilus just now, and when I right click one of the search results, there's an "Open Containing Folder" option that launches the file's folder in Nautilus (with the file highlighted). Is this what you want? If not, what's missing?

share|improve this answer

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