Bash shell instead of Ash

sezione dedicata ai sistemi operativi alternativi Open Source

Bash shell instead of Ash

Messaggio da leggereda root » 22/01/2018, 12:20

In case you have an external overlay (USB) you can have bash instead of ash, so you can save your shell command history.

NOTE: don't do this without an external USB overlay to avoid the internal router flash memory wearing.


OpenWrt comes with Ash shell. If you would like to use Bash instead, here is how you can switch and add some nice colouring to it. Install Bash by issuing the following:

opkg update
opkg install bash

Then edit "/etc/passwd" file and change the root user line to this:


After that, run this command (which will create "/root/.bash_profile" file and put “. $HOME/.bashrc” in it):

echo ". $HOME/.bashrc" > /root/.bash_profile

Then you can either use your own .bashrc or download the one that I use (I got it from Arch wiki a few years ago) and put it in your root directory like this (if you would like to use your own .bashrc, make sure to put it in /root as well):

wget -P /root/

Now log out, and log in again and you should have a brand new prompt.

Extracted from:
Avatar utente
Messaggi: 365
Iscritto il: 10/04/2012, 10:55
Località: Turin

Torna a OpenWRT

Chi c’è in linea

Visitano il forum: Nessuno e 1 ospite