Display current directory on prompt?


#1

When I use ssh, the prompt looks like this:

[apocalypse]$

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:

mysql>

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


#2

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?


#3

nvm, I figured it out.

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