2

I want to hide the current path, user and computer name in the terminal in order to have more space.

Currently, in my terminal, it echoes: "user@computername:~/currentdirectoy" and I want to hide all of them since I don't need them.

ubuntu version:18.04 Desktop

Screen shot of the terminal

2 Answers 2

4

For my Ubuntu 18.04.3 LTS works in the next way:
.- Find the bashrc

ls -la ~/ | more

.- Editing the file:

nano ~/.bashrc  

.- Replace the w for W:
Before:

PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '

After:

PS1='${debian_chroot:+($debian_chroot)}\u@\h:\W\$ '
Sign up to request clarification or add additional context in comments.

Comments

1

I found out that:

1- you can modify it by entering

    PS1="something you want including static text and variables"

, but it would change back to the default as soon as you open a new terminal.

2- You can change it permanently for the current user by editing the ~/.bashrc file and changing all the PS1 = something to what you want. I just add "#" in front of all the current PS1 lines to comment it out and then wrote my own.

here is a good source: to find out more about bash conventions and variables.

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.