The /bin/sh
(dash) shell is a POSIX compliant, reduced functionality shell to be more efficient (smaller) for booting the system. As part of that, history and advanced command-line editing are not included. It is more appropriate for strict POSIX scripting than as an interactive shell. The idea is that the 'login' shell would be bash by default, but the boot system would be using dash. The man page in Ubuntu 11.04 shows that dash has history and command-line editing, but the program does not have these features. Take a look at the size of the base executables.
$ ls -l /bin/*ash /bin/sh
-rwxr-xr-x 1 root root 822420 Mar 31 15:26 /bin/bash
-rwxr-xr-x 1 root root 83848 Nov 15 2010 /bin/dash
lrwxrwxrwx 1 root root 4 May 17 21:15 /bin/rbash -> bash
lrwxrwxrwx 1 root root 4 May 17 21:15 /bin/sh -> dash
$ strings /bin/bash | egrep -ci 'fc|hist'
181
$ strings /bin/dash | egrep -ci 'fs|hist'
1
Try to get used to running $SHELL
or bash
instead of just sh
.
sh
login shell ... Oh my. – Tobias Aug 31 '20 at 13:29