In my main ubuntu account I creating on install terminal works as expected, but in an account I created, I cannot use up down keys to navigate history. also I cant seem to use !! to use last command ... below is what I get when using up down buttons

$ ^[[A^[[A^[[A^[[B^[[B
  • 1
    Next time, use the User Accounts view in the Gnome settings, or use the adduser command. Do not use the useradd command for creating a user.
    – geirha
    Sep 3 '13 at 8:19

That user account is not using bash (or one of the other built in shells).

Type bash on the $ and you will get another prompt and history will be there (albeit showing only the bash history and not what was executed on the $ you have now).

Have a look at /etc/profile not being sourced. The 1st answer should cover what you want.

EDIT: How do you use a shell other than bash at a terminal as default? is even better (credits to Takkat).


It looks like the shell assigned for that user is not the bash shell (could be the sh shell). To verify this - open the /etc/passwd file in a text editor (sudo if you're going to edit it) and find the line corresponding to the account concerned. If the line doesn't end with ":/bin/bash", then you can modify the last part of the line

:/bin/sh (or /bin/ksh or whatever it might have been)

to be


save the file, and open another login terminal as that user.

You may edit an account's login shell using the GUI too if you wish.

Up to 10.10 navigate to System/Administration/Users and Groups -- Advanced settings - Advanced Tab - and edit the 'Shell' setting (make it /bin/bash)

On 11.04 (unity) - Power Icon menu - System Settings - System Section - Users and Groups -- Advanced settings - Advanced Tab - and edit the 'Shell' setting (make it /bin/bash)

The terminal shells available are many - and everybody has their favourite. Try each out until you find the one you like.

  • sh - Bourne shell - named after and written by Steve Bourne. This is one of the oldest shells.
  • bash - Bourne again shell - A superset of the Bourne shell. Part of the GNU project.
  • dash - The debian shell. A lightweight shell (low mem, fewer features)
  • ksh - The korn shell. Useful to know if you like VI
  • zsh - The Z shell. A user friendly shell with a LOT of features.
  • psh - The perl shell. The power of perl in your shell.
  • fish - A beginner friendly shell (Friendly Interactive SHell)

There are many more.


When I experienced the same problem on my mac os (terminal iTerm2), I assigned for down arrow key HEX-code 0x0E (in order to list history down you need press Ctrl+N which equals to that code - http://www.cisco.com/en/US/docs/ios/12_2/configfun/command/reference/frf019.pdf)

So everything got fixed.

UPDATE: well, maybe by answer is in wrong place since it does not refer to Ubuntu specifically (I am not sure how is it possible to do in Ubuntu - maybe somehow via configuration file?). Anyway, here are the iTerm2 settings:

enter image description here

  • 1
    Welcome to Ask Ubuntu Alex! Can you please explain how did you assign the down arrow key to that hex code? You can always edit your answer by clicking the edit link right underneath the body of the post.
    – Alaa Ali
    Sep 3 '13 at 7:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.