2

When I'm working inside a directory in my console, this line user@user:/a/very/very/very/very/long/path$ is disturbing me. Is there a way to minimize or delete the path from the console.

2 Answers 2

2

Simply export the PS1 env variable to what you want to display, example :

export PS1='$(whoami)@$(hostname):'

If you want this to be permanent, make sure to configure it in $HOME/.bashrc or $HOME/.bash_profile.

Sign up to request clarification or add additional context in comments.

Comments

1

Configure the $PS1 variable to your liking. See PROMPTING in man bash for details. For example, using \W instead of \w would show only the name of the current directory, not the whole path.

export PS1='\u@\h:\W\$'

Save the line to your ~/.bashrc or ~/.bash_profile to apply the configuration to every newly started session.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.