When using the terminal in a deep folder structure sometimes the prompt can take up most of the line. Is there any way in which I can trim the working directory? I know I can do
PS1="\W >"
to only print the current directory and not the full path, but is there a way to have something like:
/home/smauel/de...ther/folder >
Best Answer
Create a small python script which implements the desired trimming logic.
Example:
~/.short.pwd.py
Now test it, from a terminal:
If you are ok with the result just append the command to your
~/.bashrc
.