Score:4

How to change the current folder in the current window of nautilus using a terminal command

cn flag

From the terminal, we can open Files (nautilus) in a specific folder providing the pathname at the terminal, e.g.

nautilus /home/user/Documents

would open a new window in the Documents folder. However, this always opens a new natuilus window, whether or not the -w (--new-window) option is specified on the command line.

Question: Is there a possibility to change the directory within a running window of nautilus to a new folder using a terminal command, perhaps via dbus?

Johan Palych avatar
us flag
Take a look here: https://unix.stackexchange.com/questions/593851/is-there-a-way-to-get-a-current-directory-of-a-nautilus-window https://askubuntu.com/questions/915455/can-i-make-nautilus-launch-different-directory-than-home?noredirect=1&lq=1
vanadium avatar
cn flag
@JohanPalych Thanks for the pointers. Idea here is to change directory in one of the existing windows through a command. Second link thus is not applicable. First link is interesting in how it allows to monitor the current directory nautilus, but does not immediately help on how to change the directory through a command.
Johan Palych avatar
us flag
I usually use custom scripts for nautilus. It may come in handy: https://wiki.archlinux.org/title/GNOME/Files#:~:text=in%20the%20other.-,Custom%20scripts,-Scripts%20placed%20in https://www.gnome-look.org/browse?cat=126
vanadium avatar
cn flag
I also do. However, I wonder how one could have a current window display a different folder.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.