Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 01-19-2005, 02:14 AM   #1
jagroop mand
LQ Newbie
Registered: Dec 2004
Posts: 8

Rep: Reputation: 0
removing only most previously executed command from history?

hello friends,

i am new to this form .
my problem is that i want to delete only the most recently executed command from history without manually editing the file .
for eg. i open .bash_history file with vi command & i delete some previously
executed commands manually . now when i save the changes
& logout , then login again .bash_profile contains entry of "vi .bash_profile"
in it , which i don't want.
so please help me.
ur friend,
Old 01-19-2005, 05:54 AM   #2
Senior Member
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 48
I don't think theres a way of editing the history without it being recorded in the history, but you can exclude things from being inserted into history in the first place. Maybe you could exclude the history command, and edit the history with that. History reference
Old 01-19-2005, 06:39 AM   #3
jagroop mand
LQ Newbie
Registered: Dec 2004
Posts: 8

Original Poster
Rep: Reputation: 0
Thumbs up

Last edited by jagroop mand; 01-19-2005 at 06:41 AM.


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 history? King4lex Linux - Newbie 4 09-03-2004 09:35 PM
No effect when 'export' command executed in a script? sylvain_gnu Linux - Software 6 04-20-2004 08:15 PM
How find which command has been executed by which user. HPUX 11.11 OS kshell murugesan Linux - Distributions 3 04-16-2004 06:26 AM
How do I undo last command executed? Elfking Linux - General 4 02-05-2004 02:18 AM
Finding and Removing previously installed software SirLancelotX Linux - Software 3 07-24-2003 06:46 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:08 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration