(included) No Duplicates in Zsh or Bash

Here you will find information that will save you time and frustration.

Moderator: Founder

(included) No Duplicates in Zsh or Bash

PostPosted by natemaia » Tue Jun 13, 2017 8:21 pm

This little trick will make it so duplicate commands wont be shown to you when going through previous commands in a terminal, no more going up through hundreds of ls -a or cd

Add to your .zshrc
Code: Select all
setopt EXTENDED_HISTORY
setopt HIST_EXPIRE_DUPS_FIRST
setopt HIST_IGNORE_DUPS
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_IGNORE_SPACE
setopt HIST_FIND_NO_DUPS
setopt HIST_SAVE_NO_DUPS


Add to .bashrc
Code: Select all
export HISTCONTROL=ignoreboth:erasedups
User avatar
natemaia
ArchLabs Guru
ArchLabs Guru
 
Posts: 75
Joined: Thu Mar 16, 2017 10:14 pm
Location: Canada - British Columbia
Running Release: 5.0

Re: No Duplicates in Zsh or Bash

PostPosted by blaze » Wed Jun 14, 2017 12:54 am

Thanks natemaia. :)
Duck & Cover!!! ARCHLabs is blazing!
User avatar
blaze
 
Posts: 213
Joined: Sat Mar 04, 2017 3:27 am
Running Release: 4.1

Re: No Duplicates in Zsh or Bash

PostPosted by Dobbie03 » Wed Jun 14, 2017 6:34 pm

Thanks for the tip.
I like my Metal like my coffee.......black
User avatar
Dobbie03
Founder
Founder
 
Posts: 558
Joined: Sat Feb 18, 2017 2:51 pm
Location: New Zealand
Running Release: DobbieBang

Re: No Duplicates in Zsh or Bash

PostPosted by ector » Wed Jun 14, 2017 9:16 pm

thank @matemaia
ector
 
Posts: 23
Joined: Thu Jun 01, 2017 6:14 am

Re: No Duplicates in Zsh or Bash

PostPosted by erikdubois » Mon Jun 19, 2017 9:32 pm

incorporated in R2-D2
Living to learn, learning to live.
Linux fits well in my life's motto.
More info on http://erikdubois.be
Archlabs support articles are on https://goo.gl/AaYI0b
Archlabs support youtube channel is on https://goo.gl/Lovquv
User avatar
erikdubois
Site Admin
Site Admin
 
Posts: 333
Joined: Sun Mar 05, 2017 5:42 am
Location: Belgium


Return to Tips and Tricks

Who is online

Users browsing this forum: No registered users and 0 guests

cron