Shorten The Bash Prompt

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
the mint ninja
Level 1
Level 1
Posts: 28
Joined: Tue Feb 14, 2017 10:42 pm

Shorten The Bash Prompt

Post by the mint ninja » Mon Mar 06, 2017 3:16 am

So I have these really long directories trees, and I'd like to shorten the command prompt in the terminal. I found a some help, but it was for Ubuntu. http://hochulshin.com/ubuntu-shortening-bash-prompt/ Is there something like this for mint that works?

User avatar
chrisuk
Level 5
Level 5
Posts: 593
Joined: Thu Jun 12, 2008 6:16 am

Re: Shorten The Bash Prompt

Post by chrisuk » Mon Mar 06, 2017 3:27 am

Have a read here should apply to Bash on Mint too
Chris

Manjaro MATE - MX Linux - LMDE MATE

the mint ninja
Level 1
Level 1
Posts: 28
Joined: Tue Feb 14, 2017 10:42 pm

Re: Shorten The Bash Prompt

Post by the mint ninja » Mon Mar 06, 2017 3:36 am

Is there a way to reset the .bashrc file if I want to go back to the defaults?

User avatar
jimallyn
Level 18
Level 18
Posts: 8945
Joined: Thu Jun 05, 2014 7:34 pm
Location: Wenatchee, WA USA

Re: Shorten The Bash Prompt

Post by jimallyn » Mon Mar 06, 2017 4:30 am

the mint ninja wrote:Is there a way to reset the .bashrc file if I want to go back to the defaults?
Save the original as .bashrc.OLD. Or whatever.
Image

“If the government were coming for your TVs and cars, then you'd be upset. But, as it is, they're only coming for your sons.” - Daniel Berrigan

fabien85
Level 7
Level 7
Posts: 1574
Joined: Tue Mar 11, 2014 4:30 pm

Re: Shorten The Bash Prompt

Post by fabien85 » Mon Mar 06, 2017 6:24 am

I use PROMPT_DIRTRIM=3 in my bashrc to limit the number of directories listed in the prompt.

Habitual
Level 13
Level 13
Posts: 4870
Joined: Sun Nov 21, 2010 8:31 pm
Location: 0.0.0.0

Re: Shorten The Bash Prompt

Post by Habitual » Mon Mar 06, 2017 8:59 am

the mint ninja wrote:Is there a way to reset the .bashrc file if I want to go back to the defaults?
Great Question.

Ask the system

Code: Select all

man bash

George99
Level 3
Level 3
Posts: 106
Joined: Sun Aug 10, 2014 10:59 am

Re: Shorten The Bash Prompt

Post by George99 » Mon Mar 06, 2017 9:17 am

the mint ninja wrote:Is there a way to reset the .bashrc file if I want to go back to the defaults?

Code: Select all

cp /etc/skel/.bashrc ~
will overwrite your .bashrc with the default one of Mint.

Habitual
Level 13
Level 13
Posts: 4870
Joined: Sun Nov 21, 2010 8:31 pm
Location: 0.0.0.0

Re: Shorten The Bash Prompt

Post by Habitual » Mon Mar 06, 2017 11:08 am

you can, if you are 'stuck" on some visual issue,
start bash without an rc using

Code: Select all

bash --norc
You could have a PS1 prompt that's far too long, or some other "exotic". wut? could happen. :mrgreen:

Post Reply

Return to “Newbie Questions”