When I fist start Nautilus I invariably open five favourite tabs..

I've tried multiple URIs from the command line, but it opened multiple windows.

Is it possible to somehow do this via command-line ?...

  • This doesn't appear possible, best thing to do here is probably file a wishlist bug upstream in Nautilus and see if someone will implement it. – Jorge Castro Feb 13 '11 at 19:49
  • @Jorge: Thanks... In that case, I've hacked a macro workaround, and posted the script as an answer – Peter.O Feb 14 '11 at 6:29
  • check this with --continue option – Aquarius Power Dec 30 '14 at 16:34

As per jorge's comment, the answer is "no"...

So as a side issue, because it's not a current option in Nautilus, I've cobbled together a script.. It suits me, given the situation.
I initially had some timing inssues which caused modifier-key states to go whacko, so I've added 100ms delays between steps, and it is now behaving itself on my system...
This may need to be changed in a different environment... Here it is; at paste.ubuntu.com

  • 2
    The script is no longer online... Can you place it online gain? – WG- Mar 5 '13 at 23:22
  • do you still have that script? – Aquarius Power May 31 '14 at 7:42
  • 1
    there is this now – Aquarius Power Dec 30 '14 at 16:35

It is still unsupported by Nautilus itself, however you can use a script that admits several parameters to reuse or open a new instance of Nautilus if not running.

In order to use this solution you'll need to install pachages wmctrl and xclip. You can do it installing wmctrl and xclip using the Software Center (click on the links) or via Terminal with sudo apt-get install wmctrl xclip.

Create a new file nautab.sh and add the following code:

# Nautilus opens folders in new tabs
# Dependencies: sudo apt-get install wmctrl xclip
# Pass directories as parameters, i.e. nautab /opt /var/log /usr/local/etc
# Wrong parameters will be shown as invalid directories

if [ "$(wmctrl -xl | grep "nautilus\.Nautilus")" == "" ]; then
    # wmctrl reports Nautilus not running
    if [[ -d $1 ]]; then
        nautilus "$1" &
        >&2 echo Not a directory: $1
        nautilus &
    # Nautilus takes some time to become responsive to automation
    sleep 2
#Save old clipboard value
oldclip="$(xclip -o -sel clip)"
for folder in "$@"
    if [ -d "$folder" ]; then   
        echo -n $folder | xclip -i -sel clip
        wmctrl -xF -R nautilus.Nautilus && xdotool key --delay 120 ctrl+t ctrl+l ctrl+v Return
        # Use this if you suspect funny clipboard behaviour
        #xclip -verbose -o -sel clip
        #Leave some time before opening a new tab
        sleep 0.5
        >&2 echo Not a directory: $folder 
#Restore old clipboard value
echo -n "$oldclip" | xclip -i -sel clip

This code is based is based on an answer to other question: http://askubuntu.com/questions/55656/open-nautilus-as-new-tab-in-existing-window.

Runnautab [directory]... and new tabs will open on it. Note that there will be some delay; this is in order to wait for Nautilus to be responsive. Feel free to play with numbers.

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.