Terminal – My Terminal Prompt Is Too Long

When I created my virtualbox ubuntu machine, I happened to have a long user name, datafireball, which is 12 characters long, and again, I happened to have a long host name too which is datafireball-VirtualBox, which is 12+1+10=23 characters long. So whenever I open up a terminal, the prompt is at least username+@+hostname+:+currentdirectory+$+ space, which is 40 characters in this case… it totally take over more than half of my terminal available space. I did some google search and this post from nixcraft helped me a lot.

In the end, it is all about customizing the environment variable PS1 (prompt setting), in my case, I only need to run the command PS1=, four letters only and I won’t even have a prompt! Since I am doing that only in my session, so I can still get my settings back whenever I open another session. You can also make that change permanently by adding your own settings to profile.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s