/ Published in: Bash

This is for debian but can be adapted with little trickery to any Linux distro. This enables changing the root of a shell so that the directories displayed are not too long.
Useful for dir-verbose frameworks like symfony or when managing a huge website directory.
Usage: setroot $PWD
Useful for dir-verbose frameworks like symfony or when managing a huge website directory.
Usage: setroot $PWD
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function setroot { web_root=$1 PS1='${debian_chroot:+($debian_chroot)}\u@\h:$(echo \w| sed s@'$web_root'@@g)\$ \[\033k\]$(basename "\w")\[\033\\\]' export PS1 alias ca="cd $PWD" } # this can be adapted
Comments
