Ways to organize and access frequently visited directories and files

directorydirectory-structurefilesfilesystemsnautilus

In my Ubuntu, I have added some frequented directories to the bookmarks of Nautilus, for visiting them quicker.

Nautilus can consume a lot of memory, when it has been kept open for long and there have been many tabs opened in it. Nautilus can also close itself unexpectedly, and makes me lose track of what dirs I was working with.
So I am thinking about some alternatives to Nautilus (both GUI and CLI are fine).

I guess that command line is the simplest option. But I will miss the bookmark convenience of Nautilus.

  1. What are some good practices/ways to remember and organize frequented dirs?
  2. What I have thought is to create a dir, and store links to
    frequented dirs there. Are there better ways?
  3. Is it possible to convert the dir bookmarks in Nautilus to links?
  4. I am looking for where the dir bookmarks of Nautilus are stored, but
    to no avail:

    $ find ~ -name nautilus | less
    
    ./.config/nautilus
    ./.gconf/apps/nautilus
    ./.gconf/apps/ubuntuone/nautilus
    ./.gnome2/accels/nautilus
    

    I checked the above locations, and content of the files there, but
    didn't find anything for bookmarks.

Best Answer

Command Line Tools

I use autojump myself and I also depend on many aliases for navigating at the command line, e.g.:

alias b='cd -'
alias c='cd ~/Dropbox/95_2014/work/code'
alias d='~/Dropbox'
alias lnk='cd ~/Dropnot/webs/rails_apps/linker'
alias n='cd ~/Dropnot'
alias play='cd ~/play/'
alias q='cd ~/Dropbox/95_2014/work/code/ruby__rails/ruby/ruby_quiz'
alias s='cd ~/Dropnot/setups'
alias w='cd ~/Dropnot/webs'
alias work='cd ~/Dropbox/95_2014/work'

I keep these and all my other aliases in a ~/.bash_aliases file and include it with

test -f ~/.bash_aliases && . $_

in my .bashrc file.

For my autojump installation I have this line in my .bashrc

test -s ~/.autojump/etc/profile.d/autojump.sh && . $_

which maintains the portability of my .bashrc dot file as it allows me to have that line even on a new machine without autojump installed without error.

Organization

For the actual organization, I use:

~/Dropbox               # stuff for the future / elsewhere, maintained by Dropbox
~/Dropnot               # stuff for git, not Dropbox, i.e. sites and apps
~/Dropbox/95_2014       # My 'year' approach to archiving old stuff every year
~/Dropbox/95_2014/work  # All my work stuff which is most of it.
~/Dropbox/95_2014/life  # All my non-work, personal and private stuff

I also use:

~/tmp # as a scratchpad directory for files I don't care about.

~/setups # for a cloned github repo with my dotfiles.

and the folllowing system directories

~/Downloads
~/Desktop
~/Pictures

for quick usage, e.g. screenshots, downloads, etc.

Other tools:

I've also set autocd which allow you to type a directory name and be cd'd into it if it exists (ok in Ubuntu but in OSX I had to upgrade my bash version from 3 to 4. The line that invokes it is:

[ ${BASH_VERSINFO[0]} -ge 4 ] && shopt -s autocd

I also find it helpful to have directory info in my PS1 prompt to show me the top three (current) directories and the bottom two, plus time, name machine and git branch, as in

enter image description here

which I achieve by having the following in my .bashrc

git_branch () { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'; }
HOST='\033[02;36m\]\h'; HOST=' '$HOST
TIME='\033[01;31m\]\t \033[01;32m\]'
LOCATION=' \033[01;34m\]`pwd | sed "s#\(/[^/]\{1,\}/[^/]\{1,\}/[^/]\{1,\}/\).*\(/[^/]\{1,\}/[^/]\{1,\}\)/\{0,1\}#\1_\2#g"`'
BRANCH=' \033[00;33m\]$(git_branch)\[\033[00m\]\n\$ '
PS1=$TIME$USER$HOST$LOCATION$BRANCH

Note the carriage return so that the long PS1 prompt doesn't push the cursor way over to the right.

Bookmarks from Nautilus

I like these in nautilus but avoid accessing or using them at the command line. I don't want to have to deal with the syncing issue that might involve; I use OSX (as well as Ubuntu) and it wouldn't be of use there; the above strategy of aliases at the command line serves me better; I only like 6-12 bookmarks in the gui side panel anyway so that's not hard to just create on the fly (<1 minute one-time task).