Score:0

How to make the current working directory be highlighted in color?

bi flag

my ns-3 is installed inside the source folder i.e., home/my_username/source/ns-3.39, when I try to ls inside the ns-3.39 directory, it gives: ls: cannot open directory '.': Permission denied So I have to su root and then enter the ns-3.39 directory to use it. The problem is, in doing that, the pwd does not get highlighted while in the former situation, the pwd is highlighted in green. How can I make the su root solution also show the pwd in highlighted mode?

without su root
with su root

Score:0
fr flag

To show colored prompt all you need to do is change the PS1 variable. Run

export PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' # from default bashrc

this would set colored. You can add it at the bottom of /root/.bashrc so that bash starts with the above value of PS1.

[0] https://wiki.archlinux.org/title/Bash/Prompt_customization

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.