LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-30-2003, 09:02 AM   #1
swmok
Member
 
Registered: Jul 2003
Posts: 152

Rep: Reputation: 30
Turn off "bash_history"


Hi all:

Every I log out the system, the system will generate a ".bash_history"
file to record down my pass command.

I would like to turn this feature off.
How?

Thanks.

Mok
 
Old 11-30-2003, 09:14 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
in your .bashrc, try adding "export HISTFILE=/dev/null" or "unset HISTFILE", or possibly make a symlink of /dev/null to .bash_history, or change the permissions on the file to prevent writing to it.

Last edited by acid_kewpie; 11-30-2003 at 09:15 AM.
 
Old 11-30-2003, 07:46 PM   #3
opafire
Member
 
Registered: Oct 2003
Location: Colorado Springs
Distribution: Slackware, no more RH or Mandrake for me
Posts: 122

Rep: Reputation: 15
why would you want to turn of bash_history, it's really convenient!
 
Old 09-22-2012, 04:48 PM   #4
conroe64
LQ Newbie
 
Registered: Sep 2012
Posts: 1

Rep: Reputation: Disabled
solution

In case anyone else is looking for an answer to this, just type:

HISTIGNORE="*"

to turn it off, and

unset HISTIGNORE

to turn it back on again
 
Old 09-22-2012, 05:44 PM   #5
Basher52
Member
 
Registered: Mar 2004
Location: .SE
Distribution: Arch
Posts: 401

Rep: Reputation: 22
Quote:
Originally Posted by opafire View Post
why would you want to turn of bash_history, it's really convenient!
yeah
 
Old 09-22-2012, 07:12 PM   #6
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by swmok View Post
Hi all:

Every I log out the system, the system will generate a ".bash_history"
file to record down my pass command.

I would like to turn this feature off.
How?

Thanks.

Mok
Re: Acid_Kewpie's advice...
Code:
rm /home/$user/.bash_history
ln -sf /dev/null /home/$user/.bash_history

Last edited by Habitual; 09-22-2012 at 07:13 PM.
 
1 members found this post helpful.
Old 09-22-2012, 11:21 PM   #7
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Quote:
Originally Posted by Habitual View Post
Re: Acid_Kewpie's advice...
Code:
rm /home/$user/.bash_history
ln -sf /dev/null /home/$user/.bash_history
Why the rm if you use the -f option in the ln?
 
1 members found this post helpful.
Old 09-23-2012, 03:53 AM   #8
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,248
Blog Entries: 8

Rep: Reputation: 235Reputation: 235Reputation: 235
Or better yet:
Code:
echo 'shopt -u -o history' >> ~/.bashrc && exec bash
Optionally you could remove the .bash_history file before that.

Last edited by konsolebox; 09-23-2012 at 03:57 AM.
 
Old 09-23-2012, 09:06 AM   #9
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by PTrenholme View Post
Why the rm if you use the -f option in the ln?
I dunno, It is not my snippet, I just 'borrowed' it and never had to actually use it or read the man page until now!
Code:
--force
              remove existing destination files
Corrected and credit given here

Thank you!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SuSE 9.2 XDM turn "off" authoritative DNS queries confused-but-committ Linux - Software 1 07-29-2005 04:32 PM
Why do i get an "out of range" error on my monitor when i turn on suse9.1 linux? bobby1970 Linux - Hardware 4 06-24-2005 04:25 AM
delete ".bash_history" swmok Linux - Software 5 12-11-2003 01:39 PM
Can I turn my box into a "Hub" with 2 network Cards?? Atmosphere Linux - Networking 2 10-21-2003 10:03 PM
Question about ".bash_history" yuzuohong Linux - General 2 09-17-2002 06:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration