Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
07-30-2004, 12:26 PM
|
#1
|
LQ Newbie
Registered: Jul 2004
Location: nigeria
Distribution: mandrake
Posts: 4
Rep:
|
How do I clear history in Linux
Hello all,
Please can anybody help me with a command to clear history of all the command I ever typed from command prompt in Linux. I share a system with a number of people that access the system with the same username. I wouldn't want somebody to re-execute a command that I had already executed before either by mistake or intentionally.
I have tried using "man history" on mandrake 9.1 but did not give me any result. I also searched the web without success.
Thanks in advance
Ibrahim
|
|
|
07-30-2004, 12:49 PM
|
#2
|
Member
Registered: Jul 2004
Location: Woodland Hills, CA
Distribution: Debian/Mandrake
Posts: 37
Rep:
|
Depends on which shell you use...but the most common is bash, and I believe it is the default... Chances are, anyway.
If you change to your home directory, and do:
ls -al
You should see a file called: .bash_history
That file will contain all (maybe just most, can't remember what the cap is, if any) of the command line history.
To clear it, like you want, you can simply delete that file.
|
|
|
07-30-2004, 12:51 PM
|
#3
|
Member
Registered: Apr 2004
Location: berkeley, ca
Distribution: slk10, winxp
Posts: 313
Rep:
|
if you use bash, there's .bash_history in your home directory, remove it. if you use another shell, look for a similar file.
--posting at the same time--
|
|
|
08-03-2004, 12:36 AM
|
#4
|
Member
Registered: Aug 2004
Distribution: Slackware 10
Posts: 110
Rep:
|
I personally like to set an alias to do this it's always set as...
alias history="rm .bash_history"
|
|
|
08-03-2004, 07:14 AM
|
#5
|
LQ Newbie
Registered: Aug 2004
Location: US
Posts: 27
Rep:
|
use history -c to clear everything
|
|
1 members found this post helpful.
|
08-03-2004, 07:20 AM
|
#6
|
Senior Member
Registered: Mar 2003
Location: Beautiful BC
Distribution: RedHat & clones, Slackware, SuSE, OpenBSD
Posts: 1,791
Rep:
|
edit your .bashrc and add
HISTFILESIZE=0
HISTSIZE=0
Of course, you will not be able to use the up-arrow to retrieve your previous command. OR set HISTSIZE to something that will allow minimum exposure.
|
|
|
08-03-2004, 09:44 AM
|
#7
|
LQ Newbie
Registered: Jul 2004
Location: nigeria
Distribution: mandrake
Posts: 4
Original Poster
Rep:
|
Thanks all,
all the suggestions worked as explained. I found "history -c " command most straight-forwad. Thaks to everybody once again
IbrahimT
|
|
1 members found this post helpful.
|
07-14-2009, 02:09 AM
|
#8
|
LQ Newbie
Registered: Jul 2009
Posts: 1
Rep:
|
Quote:
Originally Posted by liinux
use history -c to clear everything
|
Thanks alot, it's really helpful
|
|
2 members found this post helpful.
|
07-14-2009, 02:15 AM
|
#9
|
LQ Guru
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870
|
Quote:
Originally Posted by dr.ash
Thanks alot, it's really helpful
|
dr.ash, please don't resurrect dead threads.
BTW, there's a Thanks button attached to every post, for when you are feeling thankful.
|
|
1 members found this post helpful.
|
All times are GMT -5. The time now is 02:59 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|