Display current directory on prompt?

When I use ssh, the prompt looks like this:


I was wondering if it was possible to show the current directory I’m in instead, like this?

/home/foo %

The same is true for the MySQL command line tool. I’m used to it showing the current database I’m using, but instead it just says:


…even after I type ‘use some_database’. Is there any way to change this?

I figured out how to accomplish this for both prompts (bash and mysql). I’ve edited my .bash_profile so that it will make this change permanent, so to speak.

To make the mysql prompt change permanent, I need to edit the my.cnf file, which is in /etc/mysql. The file is read-only, though, and if I try to chmod it, it says ‘Operation not permitted.’

I guess that’s probably just a limitation I have to deal with, right?

nvm, I figured it out.

You can make your own .my.cnf file in your home directory.