Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
share|improve this question
    
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

3 Answers 3

up vote 2 down vote accepted

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).

share|improve this answer

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

:/bin/bash

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.

share|improve this answer

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 regard to ubuntu specifically (I am not sure how is it possible to do in Ubuntu - maybe somehow via configuration file?). Anyway, please see screenshot for iTerm2 settings - http://i.stack.imgur.com/aWjmI.png (sorry, don't have enough reputation to post image)

share|improve this answer
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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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