I had to modify Jeroen's code to get the `marks` shortcut working under Mac OS 10.8: export MARKPATH=$HOME/.marks function jump { cd -P $MARKPATH/$1 2> /dev/null || echo "No such mark: $1" } function mark { mkdir -p $MARKPATH; ln -s $(pwd) $MARKPATH/$1 } function unmark { rm -i $MARKPATH/$1 } function marks { ls -l $MARKPATH | sed 's/ / /g' | cut -d' ' -f9- && echo }
Here is another version of 'marks' for Mac OS that aligns the arrows. It also works when 'ls' is aliased. function marks { \ls -l $MARKPATH | tail -n +2 | sed 's/ / /g' | cut -d' ' -f9- | awk -F ' -> ' '{printf "%-10s -> %s\n", $1, $2}' }
function marks {
(cd $MARKPATH && stat -f"%-10SN%SY" *)
}
Even better with column (t="$(printf "\t")"; cd $MARKPATH && stat -f"%N$t%SY" * | column -ts"$t")