3

Is there a way that I can remove repeated commands from bash history?

For example: I run the mv command once, then I run the ls command n times.

I have to press the up arrow n times to get the mv command again.

How can I keep just one ls command instead of n.

1 Answer 1

12

Setting the following environment variable:

HISTCONTROL="ignoredups"

Will prevent duplicate commands from being logged.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .