Home / Tips / Linux / Avoiding duplicate entries in command-line using Bash

Avoiding duplicate entries in command-line using Bash

Linux
 
Linux
  • Currently 0 out of 5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Rating: 0/5 (0 votes cast)

Thank you for rating!

You have already rated this page, you can only rate it once!

Your rating has been changed, thanks for rating!

Log in or create a user account to rate this page.


To keep your Bash history organized and avoid duplicate entries, you may add the following configuration line to your .bashrc file:

export HISTCONTROL=ignoredups:erasedups

Or simply run this command:

cd; sed -i '$ a\export HISTCONTROL=ignoredups:erasedups' .bashrc

Done! Next time you log in, the duplicate commands will be long gone.


 

Read also

Troubles with memory leak and OOM-killer

Troubles with memory leak and OOM-killer

Install MySQL server on FreeBSD

Install MySQL server on FreeBSD

Install Apache in FreeBSD

Install Apache in FreeBSD

Log in or create a user account to post a comment.