3 votos

ignorar duplicados al navegar por el historial de bash

Supongo que tengo el siguiente historial de comandos:

  • UNA
  • si
  • si

Al presionar la flecha hacia arriba en la mayoría de los terminales de Linux, esto se ciclaría así:

  • si
  • UNA

Sin embargo, en la terminal osx me consiguió:

  • si
  • si
  • UNA

¿Cómo puedo recuperar el comportamiento anterior?

2voto

Desde man bash :

 HISTCONTROL
A colon-separated list of values controlling how commands are saved on the history list. If
the list of values includes ignorespace, lines which begin with a space character are not
saved in the history list. A value of ignoredups causes lines matching the previous history
entry to not be saved. A value of ignoreboth is shorthand for ignorespace and ignoredups. 
A value of erasedups causes all previous lines matching the current line to be removed from
the history list before that line is saved. Any value not in the above list is ignored.
 

Para imitar el comportamiento al que está acostumbrado, ejecute echo $HISTCONTROL en su sistema Linux y luego configure el mismo valor en su Mac.

AppleAyuda.com

AppleAyuda es una comunidad de usuarios de los productos de Apple en la que puedes resolver tus problemas y dudas.
Puedes consultar las preguntas de otros usuarios, hacer tus propias preguntas o resolver las de los demás.

Powered by:

X