0

I am a beginner with Ubuntu 22.04.2 Desktop. Some of the commands I used before do not work right now, and history is one of them. Previously, I used MobaXterm to only download and upload files. When I used my account on Ubuntu, this is the same message I got from both of them.

enter image description here

  • You've not said what Ubuntu product/release you're using. Have you changed from the default shell? (*if you use different shells you may find you have different commands available, but have lost some of the BASH default commands*) – guiverc Mar 03 '23 at 22:09
  • 1
    Your screenshot suggests you are using `sh` - history is a feature of more full-featured shells like bash, zsh etc. - see [Arrow keys, Home, End, tab-complete keys not working in shell](https://askubuntu.com/questions/325807/arrow-keys-home-end-tab-complete-keys-not-working-in-shell) – steeldriver Mar 03 '23 at 22:12
  • I edited my question for more information. and the version of Ubuntu is 22.04.2 LTS – Fateme Nazari Mar 03 '23 at 22:12
  • `echo "$SHELL"` to see which shell you're using. Read the `man` page for that shell. – waltinator Mar 03 '23 at 22:38
  • when I used echo "$SHELL" command I got /bin/sh. I googled it and it seems that I should change the sh to bash and there is a command like chsh and when I use that I got permission error. – Fateme Nazari Mar 04 '23 at 07:48

1 Answers1

1

Based on your screenshot, you are using the sh shell. On Ubuntu systems, /bin/sh is dash, the Debian Almquist shell, which is a lightweight shell that does not provide shell history features.

To switch to Ubuntu's default interactive shell, bash, you can do any one of

  • type bash to open a new interactive shell within your sh shell

  • type exec bash to replace the current sh shell with bash

  • type chsh -s /bin/bash to set your default login shell to bash - you will be prompted to enter your password to confirm the change.

See also Arrow keys, Home, End, tab-complete keys not working in shell

steeldriver
  • 131,985
  • 21
  • 239
  • 326
  • thank you so much. The first one worked. but for chsh -s /bin/bash it says I cannot change it. so it seems I have to use bash command every time. – Fateme Nazari Mar 05 '23 at 18:04