There is a pretty awesome applescript called "Open Terminal Here" ( http://www.entropy.ch/software/applescript/ ) which you can add to your finder's toolbar and click when you want to launch a terminal console which is set to that directory.
Sometimes I need to be root, and so I end up starting terminal, doing something like sudo -i and then I have to change back to the previous directory because the sudo command is landing me in /var/root.
I'm using sudo -i because I like it to load things like aliases / the bash profile.
The script is applescript, and here's the important part of how it works:
...
set cmd to "cd " & quoted form of the_path & " && echo $'\\ec'"
...
tell application "Terminal"
activate
do script with command cmd
How do I get this to load as root?

sudo -ibecause you specifically want to run root's .profile, instead of your own? Because if it's just a case of wanting to make sure certain shell initialization files get run, that might be easier to fix and it would allow you to switch to usingsudo -sto get a root shell without changing your working directory. – Spiff Feb 23 '11 at 5:57/etc/profilefile which I believe is like a global.bash_profile- that is supposed to load for all users. I have an alias command in therealias ll="ls -al"and if I runsudo -ithen I have access to thellcommand, but if I runsudo -sthen thellcommand doesn't work. But you're right, the directory doesn't change. So how can I use applescript to launch Terminal as root? – cwd Feb 23 '11 at 14:47~/.bashrcis sourced for non-login shells. My own practice was to put all of my aliases and such in~/.bashrc, and add a. ~/.bashrcline to the end of my~/.bash_profile. The OS X bash(1) manpage doesn't indicate a system-wide equivalent to ~/.bashrc, though some other man pages suggest /etc/bash.bashrc is used. – coneslayer Feb 24 '11 at 16:57alias ll="ls -al"to all of them but it's not working for any. This actually would be the simplest solution if I could get it to work! Also, I have an /etc/bashrc file, with a comment line# System-wide .bashrc file for interactive bash(1) shells.at the top. but it too, has let met down. – cwd Mar 4 '11 at 15:24