|
|
|
|
||||||
| linux.debian.user debian-user@lists.debian.org. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
[This message has also been posted to linux.debian.user.]
In article <9nwMV-4pJ-13@gated-at.bofh.it>, Serena Cantor wrote: > I often use UP key to get commands entered previously. The shell show some commands again and > again, just because I have used them several times. Can the shell be more smart? This is bash, right? Bash is already smart. It's keeping the whole history in case you forgot what you did. Don't fight it, use it. 1. Edit your /etc/inputrc file and add the line set editing-mode vi near the beginning of the file. Now your shell, and anything else that uses GNU Readline, will have a fine set of history editing commands. Emacs users feel free to set it to emacs. If you just want to change the shell, and leave everything else emacs-ish, type set -o vi into your shell, or put that in ~/.bashrc 2. Don't use the uparrow any more. That's what the k key is for. Escape k k k k k Notice most visual editing commands work, so you can change the commands instead of just recalling them. When you get tired of that, there is a search command. Escape /^grep to find the last command that began with grep. Your favorite regular expressions work. Now you can blow past the duplicate commands to the one you want. Cameron -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
On Mon, Nov 12, 2007 at 10:49:49PM -0800, cls@truffula.sj.ca.us wrote:
> > [This message has also been posted to linux.debian.user.] > In article <9nwMV-4pJ-13@gated-at.bofh.it>, Serena Cantor wrote: > > I often use UP key to get commands entered previously. The shell show some commands again and > > again, just because I have used them several times. Can the shell be more smart? Put this line into .bashrc: export HISTCONTROL=ignoredups -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
On Wed, 14 Nov 2007 11:09:35 +0100, Misko wrote:
> On Mon, Nov 12, 2007 at 10:49:49PM -0800, cls@truffula.sj.ca.us wrote: >> >> > I often use UP key to get commands entered previously. The shell show some commands again and >> > again, just because I have used them several times. Can the shell be more smart? > > Put this line into .bashrc: > > export HISTCONTROL=ignoredups Mine is export HISTCONTROL=ignoreboth Even more cleaner. -- Tong (remove underscore(s) to reply) http://xpt.sourceforge.net/techdocs/ http://xpt.sourceforge.net/tools/ -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
![]() |
| Outils de la discussion | |
|
|