Skip to main content
16 events
when toggle format what by license comment
Apr 18 at 18:28 comment added Robert Dundon Adding a note here from this answer: "Note that the command lingers in the internal history until the next command is entered before it vanishes, allowing you to briefly reuse or edit the line"
Apr 6, 2023 at 8:17 comment added bravmi Btw HIST_IGNORE_SPACE is on by default in ohmyzsh, see history.zsh.
S Dec 24, 2020 at 3:30 history edited Peter Cordes CC BY-SA 4.0
and compare to bash.
S Dec 24, 2020 at 3:30 history suggested Almenon CC BY-SA 4.0
add disclaimer - without this one may think that it is not working because you can still access it
Dec 23, 2020 at 19:36 review Suggested edits
S Dec 24, 2020 at 3:30
Nov 7, 2020 at 13:09 comment added Sebastian does anyone have an idea why this doesn't work on mac? Since mac os switched to zsh as default shell I am unable to exclude any commands from the history :(
S Apr 10, 2018 at 13:54 history suggested CommunityBot CC BY-SA 3.0
Include Al.G:s explanation to the solution + readability
Apr 10, 2018 at 11:43 review Suggested edits
S Apr 10, 2018 at 13:54
Apr 6, 2016 at 17:27 comment added Al.G. For lazy future readers like me who don't know how to do it yet: setopt HIST_IGNORE_SPACE in ~/.zshrc
Oct 14, 2012 at 2:15 comment added Will Norris in order to have zsh ignore a bunch of basic common commands, I aliased them all to have a space in front... for c (ls fg bg jobs exit clear reset); do alias $c=" $c"; done
Jan 20, 2011 at 12:54 vote accept xenoterracide
Jan 19, 2011 at 14:20 comment added Keith @xeno zsh provides a hook function preexec that can be used for that. If it returns non-zero the command is not saved in history.
Jan 19, 2011 at 11:01 comment added dogbane AFAIK there is no equivalent of bash's HISTIGNORE in zsh.
Jan 19, 2011 at 10:57 comment added xenoterracide any chance @mmckinst answer works in zsh? or something like it? or perhaps any command that includes the command | somecommand
Jan 19, 2011 at 9:25 history edited dogbane CC BY-SA 2.5
deleted 1155 characters in body
Jan 19, 2011 at 9:08 history answered dogbane CC BY-SA 2.5