DEV Community

Alex Moreno
Alex Moreno

Posted on

Reduce your terminal prompt size in Mac/Linux

I really hate how much space the terminal in Macos eats.

Alt Text

That's eating some times like 60 to 80% of my terminal space, which on itself (the terminal) I like to keep small.

Easy solution though, edit your ~/.bashrc and add this line at the end:

export PS1="[..]/\W:"

Then using source against that file should get your changes:

source ~/.bashrc

Alt Text

And you can always use pwd, as you can see in my terminal, for whenever you need a reminder of the whole path where you are.

Much better, isn't it? :)

Top comments (3)

philipnorton42 profile image
Philip Norton 🌍

Good tip!
I tend to use oh_my_zsh (, which be default only shows the current directory and the git branch currently checked out.

aidanlovelace profile image
Aidan Lovelace

Why not add a new line to the end of your prompt so you can still get all the information but keep the horizontal space?

morenodotnet profile image
Alex Moreno

I like minimalistic, but that's just a personal thing, that's indeed a good idea :-)