Wednesday, April 24, 2024
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 5315  / 2 Years ago, sun, september 25, 2022, 5:45:13

I would like to shorten the file path that is currently active in the terminal to allow more space. This is a shortened example but I sometimes have filepaths that I am working with that are 6 levels deep and it would be nice to hide that.



test@ubuntu:~$ cd code/helloworld
test@ubuntu:~/code/helloworld$


would like to just see somehting like



helloworld:


Any ideas?



Thanks!


More From » command-line

 Answers
5

Add to your .bashrc or run at a prompt:



PS1='W: '


For background information, run man bash and search for PROMPTING.


[#30934] Monday, September 26, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
theurn

Total Points: 30
Total Questions: 110
Total Answers: 111

Location: Bahrain
Member since Fri, Sep 16, 2022
2 Years ago
;