Looking for where to configure the prompt (.bashrc?)

The prompt can be configured via .bashrc in the root directory /root/.bashrc ????

I have looked at the documentation and the answers to the searches do not clarify this issue.

I don't know where the prompt is configured or if the traditional prompt parameters are valid.

It's a curiosity but visually I quickly realize that I'm in the router console.

thank you



Bash is not the default shell, as OpenWrt uses ash from busybox.
So .bashrc has no role.

You can install bash and set it as the default shell for root, but it can cause problems with later sysupgrades.



 grep PS1 /etc/profile
export PS1='\u@\h:\w\$ '
[ "$TERM" = "xterm" ] && export PS1='\[\e]0;\u@\h: \w\a\]'$PS1
1 Like

Thank you all very much for your attention.

My doubts are solved, I am reading the documentation you have recommended.

Forgive me, but I don't feel comfortable with the system. I am accustomed to a classic linux. And the truth is that I'm afraid to break something....... Well I've already broken it. The advantage is that everything is in the microSD which allows you to use several and progress little by little.

A great help for a newbie in openwrt

Thanks again.


My router is running 19.07.2 and I also set bash as default for root. No problems so far. Could you introduce what is the problem in later system upgrades?

When you have set bash as the default shell for your user account and you sysupgrade to a firmware image that does not have bash included, you get locked out in practice. Bash is not included in the official images and should be reinstalled (but you can't reach the shell to do that).

That concerns sysupgrading with keeping settings. If you sysupgrade without keeping settings, the shell setting for root would revert to the default ash and you would be ok.

If you sysupgrade to your personal image where you have included bash in the image, you should have no problems.


I build my own image. Glad to know it will not cause problems for me. Thank you for your reply.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.