PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > linux.debian.user > Re: why does the shell show commands foolishly when I press UP key?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
linux.debian.user debian-user@lists.debian.org.

Re: why does the shell show commands foolishly when I press UP key?

Réponse
 
LinkBack Outils de la discussion
Vieux 13/11/2007, 07h10   #1
cls@truffula.sj.ca.us
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: why does the shell show commands foolishly when I press UP key?

[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
  Réponse avec citation
Vieux 14/11/2007, 13h00   #2
Misko
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: why does the shell show commands foolishly when I press UP key?

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
  Réponse avec citation
Vieux 08/12/2007, 16h30   #3
T o n g
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: why does the shell show commands foolishly when I press UP key?

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
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 02h31.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,13634 seconds with 11 queries