sunrat Posted June 30, 2018 Share Posted June 30, 2018 Here's something I didn't know. You can delete single commands from bash history or not log them in the first place. Say you have a command you want to delete from history: 1145 su 1146 rsnapshot -t hourly 1147 rsnapshot hourly 1148 kill-infidels 1149 history Use the -d option to delete: history -d 1148 It's gone: 1145 su 1146 rsnapshot -t hourly 1147 rsnapshot hourly 1148 history 1149 history -d 1148 1150 history Precede a command with a space and it won't appear in history at all. You need this in .bashrc for this to work but it's probably there by default: # don't put duplicate lines or lines starting with space in the history. # See bash(1) for more options HISTCONTROL=ignoreboth Quote Link to comment Share on other sites More sharing options...
securitybreach Posted June 30, 2018 Share Posted June 30, 2018 Yeah, you can do the same with any history. Bash or Zsh etc. I have never needed to remove a single entry though. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.