It's well known that if you push «up» and «down» keys in gnome-terminal, you can move on used commands. It only works for the commands wich are introduced before closing the window. When I close it, gnome-terminal forget all commands. Also, I cannot paste text w/ Ctrl+Shift+V.


The quick answer is 'add the following to the very end of your .bashrc file':

shopt -s histappend
export HISTSIZE='10000'
export HISTFILE="$HOME/.bash_history"
export HISTIGNORE=cd:ls:bg:fg:exit
export HISTCONTROL=ignoreboth:erasedups

...Or something like it, that's directly out of my .bashrc file.

The correct answer is 'read up on the bash shell'.
I highly recommend Learning The Bash Shell (http://oreilly.com/catalog/9781565923478).

Otherwise there's a lot of free material on the web to get you started, for example : http:www.ibm.com/developerworks/library/l-bash.html

Also, Romanovzky and Dennis have a valid point - the file may already be there.
You might also make sure your user owns and can write to your .bash_history file :

sudo chown $USER:$USER $HOME/.bash_history
sudo chmod u+w $HOME/.bash_history
  • Regarding pasting: You can highlight text and then paste into terminals with Shift+Insert, or with middle-click on your mouse. – JA01201 Oct 11 '10 at 2:13

Do you have the file .bash_history in your home?

  • Oh, thanks bro, I had it, but I don't know how it was locked. I deleted it and created a new one, and it works nice. – Alfredo Hernández Oct 11 '10 at 12:39

I have Maverick and in gnome-terminal I repeat old commands with the up arrow. I can also paste text with Control-Shift-V.

Regarding pasting - what happens if you copy something from within the window with control-shift-c and then try a Control-Shift-V paste - does that work? Or are things in your buffer outside of the window that are failing? Does a mouse paste work (either to the Edit -> Paste button, or right-click in the window and go down to paste) - especially from material copied from within the window? If you go to "Edit -> Keyboard Shortcuts" does it have an "Edit: Paste -> Control-Shift-V" entry?

As far as history, I echo what Romanovzky asked - do you have a .bash_history file in your home directory? Are there commands in it? Are you the owner, and do you have permission to read the file?

  • I cannot paste any text (copied from anywhere) with Ctrl+Shift+V. The entry in the right click works fine. The entries in Keyboard Shortcuts are enabled, so I do not know what's happening. – Alfredo Hernández Oct 11 '10 at 12:42

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.