LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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, 05: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 05:13 PM.
 
Old 03-07-2010, 05:12 PM   #2
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Bookworm (Fluxbox WM)
Posts: 1,391
Blog Entries: 54

Rep: Reputation: 360Reputation: 360Reputation: 360Reputation: 360
Try using the command
Code:
history -c
 
Old 03-07-2010, 05: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



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 05:19 AM
ever had problems clearing konqueror's history? -=Graz=- SUSE / openSUSE 2 09-22-2006 04:52 AM
Clearing history AumDiar Linux - Newbie 7 01-03-2005 11:05 PM
clearing konsole history minm Linux - Newbie 5 08-23-2004 08:21 AM
Problems clearing Konsole history sergeantroach Linux - Software 2 11-01-2003 04:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:31 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