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

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).
.dot
lines elsewhere... – mikeserv Jul 27 '14 at 09:11(IFS=/ ;set -- ${PWD%"${last=${PWD##/*/}}"}; printf "${1+%c/}" "$@"; printf "$last > ")
- I think that's what you're doing withsed
in$LOCATION
, and that does it using only builtins. My preference is to declare functions and call them rather than variables - they're far more useful. Still, I wish I could upvote this post twice. Have a look here if you're curious about the function thing. – mikeserv Jul 27 '14 at 18:05