LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-16-2005, 07:49 AM   #1
basilogics
LQ Newbie
 
Registered: Jun 2005
Location: Netherlands
Distribution: Suse 9.1 pro
Posts: 26

Rep: Reputation: 15
clean command line history


hello,

i made a mistake when switching to su. my password is now viewable in the commandline history. is there a way to clean the commandline history?
i use suse 9.1 pro.

thx in advance.

basilogics
 
Old 06-16-2005, 07:57 AM   #2
slackie1000
Senior Member
 
Registered: Dec 2003
Location: Brasil
Distribution: Arch
Posts: 1,037

Rep: Reputation: 46
Re: clean command line history

hi there,
Quote:
Originally posted by basilogics
hello,

i made a mistake when switching to su. my password is now viewable in the commandline history. is there a way to clean the commandline history?
i use suse 9.1 pro.

thx in advance.

basilogics
try..
Code:
history -c
regards
slackie1000
 
Old 06-16-2005, 07:59 AM   #3
basilogics
LQ Newbie
 
Registered: Jun 2005
Location: Netherlands
Distribution: Suse 9.1 pro
Posts: 26

Original Poster
Rep: Reputation: 15
that simple!
it worked
thx.
 
Old 06-16-2005, 08:05 AM   #4
slackie1000
Senior Member
 
Registered: Dec 2003
Location: Brasil
Distribution: Arch
Posts: 1,037

Rep: Reputation: 46
hi there,
yep...that simple...
from man bash...
Code:
  history [n]
       history -c
       history -d offset
       history -anrw [filename]
       history -p arg [arg ...]
       history -s arg [arg ...]
              With  no  options,  display  the command history list with line numbers.  Lines listed with a *
              have been modified.  An argument of n lists only the last n lines.  If the shell variable HIST-
              TIMEFORMAT  is  set  and not null, it is used as a format string for strftime(3) to display the
              time stamp associated with each displayed history  entry.   No  intervening  blank  is  printed
              between  the formatted time stamp and the history line.  If filename is supplied, it is used as
              the name of the history file; if not, the value of HISTFILE is  used.   Options,  if  supplied,
              have the following meanings:
              -c     Clear the history list by deleting all the entries.
....
man is always a good friend...
regards
slackie1000
 
Old 06-16-2005, 08:56 AM   #5
basilogics
LQ Newbie
 
Registered: Jun 2005
Location: Netherlands
Distribution: Suse 9.1 pro
Posts: 26

Original Poster
Rep: Reputation: 15
a good thing to remember, though
 
Old 06-16-2005, 09:19 AM   #6
oneandoneis2
Senior Member
 
Registered: Nov 2003
Location: London, England
Distribution: Ubuntu
Posts: 1,460

Rep: Reputation: 47
Alternatively, open the .bash_history file in a ext editor, and just delete the one entry from it that's bothering you
 
Old 06-16-2005, 10:27 AM   #7
basilogics
LQ Newbie
 
Registered: Jun 2005
Location: Netherlands
Distribution: Suse 9.1 pro
Posts: 26

Original Poster
Rep: Reputation: 15
you've been a great help so far.

one more thing; apache 1.3 doesn't start on boot. i know i should put the apachectl start somewhere in /etc/rc.d/r.local/ or something like this. but i don't have a rc.local. and if i had i don't exactly know on which line to put apachectl start.

thx (again)

basilogics
 
Old 10-26-2005, 12:14 PM   #8
geokker
Member
 
Registered: Jun 2004
Distribution: Ubuntu 6.10 Edgy Eft
Posts: 61

Rep: Reputation: 15
I can't find the .bash_history for root - is it called something else?
 
Old 10-26-2005, 07:59 PM   #9
maroonbaboon
Senior Member
 
Registered: Aug 2003
Location: Sydney
Distribution: debian
Posts: 1,495

Rep: Reputation: 48
Not in /root/.bash_history?

Note that 'dot' files (leading '.') do not show up in 'ls' unless you add option -a.
 
Old 11-04-2005, 05:25 AM   #10
slackie1000
Senior Member
 
Registered: Dec 2003
Location: Brasil
Distribution: Arch
Posts: 1,037

Rep: Reputation: 46
hi there,
Quote:
Originally posted by geokker
I can't find the .bash_history for root - is it called something else?
could it be that you are using another shell? tcsh? xxsh? yysh?
if so, it is clear why .bash_history does not exist.
regards,
slackie1000
 
  


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
command line history crickett Linux - General 13 12-17-2009 09:22 AM
Solaris 9 - Command line history itsjustme Solaris / OpenSolaris 4 08-03-2007 02:07 PM
command line history begby Linux - Software 7 03-12-2005 02:58 AM
How to clean ccokies&history? moon5 Linux - General 3 03-19-2004 04:05 PM
history with command line compu73rg33k Linux - Software 3 02-16-2004 04:36 AM


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