I have made a some bookmarks in Nautilus, i.e. shortcut links to some directories.
I would like to cd
to a directory which has been bookmarked in Nautilus. I was wondering if that is possible?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityI have made a some bookmarks in Nautilus, i.e. shortcut links to some directories.
I would like to cd
to a directory which has been bookmarked in Nautilus. I was wondering if that is possible?
Nautilus saves its bookmarks in a file named .gtk-bookmarks
in your home (from Ubuntu 13.04 on, it's located in .config/gtk-3.0/bookmarks
). The bookmarks are stored in clear text, one bookmark per line. With a bit of shell scripting it should be possible to parse the file and configure your shell to allow something like: cd somebookmarkname
.
Old thread, but in case it helps someone, the helpful comment by @SuperMagic didn't work for me in ksh
, so instead I put this in .kshrc
:
function cdbm {
ENTRY=$(grep "$1" $HOME/.config/gtk-3.0/bookmarks)
DIR=$(echo "$ENTRY" | sed 's|file://||g' | cut -d' ' -f1)
cd $DIR
}