LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-04-2011, 02:02 AM   #1
dEnDrOn
Member
 
Registered: Jun 2011
Location: oMNipre$ent
Distribution: fedora
Posts: 511
Blog Entries: 12

Rep: Reputation: Disabled
Question how to delete a specific command from terminal history ?


i accidently typed my root password before typing 'su',
so, now anyone can see my commands history and know password....what should i do to delete it from history.
I definitely don't want to delete complete history as it contains some very important commands.
 
Old 08-04-2011, 02:23 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
If using bash:
Code:
history -d number
where number is the position in the current history list.
 
1 members found this post helpful.
Old 08-04-2011, 02:42 AM   #3
dEnDrOn
Member
 
Registered: Jun 2011
Location: oMNipre$ent
Distribution: fedora
Posts: 511

Original Poster
Blog Entries: 12

Rep: Reputation: Disabled
Exclamation

Quote:
Originally Posted by colucix View Post
If using bash:
Code:
history -d number
where number is the position in the current history list.
thanks...i got it !!!
 
Old 08-04-2011, 02:43 AM   #4
dEnDrOn
Member
 
Registered: Jun 2011
Location: oMNipre$ent
Distribution: fedora
Posts: 511

Original Poster
Blog Entries: 12

Rep: Reputation: Disabled
Exclamation

marking thread as SOLVED.
 
Old 08-12-2011, 06:29 AM   #5
dEnDrOn
Member
 
Registered: Jun 2011
Location: oMNipre$ent
Distribution: fedora
Posts: 511

Original Poster
Blog Entries: 12

Rep: Reputation: Disabled
Question

it seems that root and normal user histories are different !
when i try to delete normal user terminal history by using command provided above,then it is deleted temporarily but when i close terminal and restart it and then browse history then that command again comes on same number.
How to delete it permanently ?
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Is there any command to delete bash command history? cola Linux - Newbie 4 06-01-2010 07:32 AM
How to delete bash terminal history upto certain no. of commands sd|| Linux - Newbie 3 01-12-2010 02:13 PM
gnome-terminal command history file?? kushalkoolwal Debian 1 03-07-2006 06:39 PM
Gnome terminal command history problem ssrini *BSD 1 07-26-2005 09:55 AM
Terminal Command History? Allen614 Linux - General 3 01-14-2003 11:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:59 AM.

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