LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices



Reply
 
Search this Thread
Old 03-07-2010, 06:10 PM   #1
grimx
Member
 
Registered: Oct 2008
Distribution: Slackware 14 i686
Posts: 111

Rep: Reputation: 16
Question clearing commandline history


how would i clear my commandline history
at logon/logoff/startup time ??

it tried this : editing my /etc/rc.d/rc.local file like this
i know this is for system startup
Code:
#!/bin/sh
#
# /etc/rc.d/rc.local:  Local system initialization script.
#
# Put any local startup commands in here.  Also, if you have
# anything that needs to be run at shutdown time you can
# make an /etc/rc.d/rc.local_shutdown script and put those
# commands in there.

#clear user history ~/.bash_history
echo "" > ~/.bash_history

#clear root history /root/.bash_history
echo "" > /root/.bash_history
but when i reboot, the history still remains.

Last edited by grimx; 03-07-2010 at 06:13 PM.
 
Old 03-07-2010, 06:12 PM   #2
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Wheezy (Fluxbox WM)
Posts: 1,368
Blog Entries: 52

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Try using the command
Code:
history -c
 
Old 03-07-2010, 06:32 PM   #3
grimx
Member
 
Registered: Oct 2008
Distribution: Slackware 14 i686
Posts: 111

Original Poster
Rep: Reputation: 16
where would i put the command to clear roots
commandline history(when using su / sudo) ??
i have these alias in /etc/profile:
Code:
alias exit='history -c ~/.bash_history && history -c /root/.bash_history && exit'
alias clear='history -c ~/.bash_history && history -c /root/.bash_history && clear'
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
tcsh: can you save the history from multiple shells to one history file? BrianK General 2 04-23-2009 06:19 AM
ever had problems clearing konqueror's history? -=Graz=- Suse/Novell 2 09-22-2006 05:52 AM
Clearing history AumDiar Linux - Newbie 7 01-04-2005 12:05 AM
clearing konsole history minm Linux - Newbie 5 08-23-2004 09:21 AM
Problems clearing Konsole history sergeantroach Linux - Software 2 11-01-2003 05:45 PM


All times are GMT -5. The time now is 03:13 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration