procedure for deleting perticular shell command from "history" command

aress24x7

Member
Aug 2, 2003
18
0
151
Hello,

I need the procedure for deleting the perticular shell command from the "history" command.I want to protect other user so that they can't know which comands was run on shell.

thank you.
 

vishal

Well-Known Member
Jan 28, 2003
339
0
166
India
Originally posted by aress24x7
Hello,

I need the procedure for deleting the perticular shell command from the "history" command.I want to protect other user so that they can't know which comands was run on shell.

thank you.
I dunno the exact way for deleting a particular command from history but if you want to CLEAR all the commands from HISTORY then use :

clear history

Hope this helps !
 

vishal

Well-Known Member
Jan 28, 2003
339
0
166
India
Re: Re: procedure for deleting perticular shell command from "history" command

Originally posted by vishal
I dunno the exact way for deleting a particular command from history but if you want to CLEAR all the commands from HISTORY then use :

clear history

Hope this helps !
Yeah here is how you can achieve that :

history -d <line number>

that line will get deleted from the history

man is your friend :D
 

aress24x7

Member
Aug 2, 2003
18
0
151
reopen

i think history's commands are store in .bash_history in ROOT.If we delete from that then .........

But still it doesn't work.

Have you any answer!!!!!!!!!
 

vishal

Well-Known Member
Jan 28, 2003
339
0
166
India
Re: reopen

Originally posted by aress24x7
i think history's commands are store in .bash_history in ROOT.If we delete from that then .........

But still it doesn't work.

Have you any answer!!!!!!!!!
Yes they are stored in .bash_history and if you delete them from the file but obvious it 's not going to affect your current history coz those are stored in the Env Variable.

Have tried :

# history -d <line number>

This should work ! :cool:
 

aress24x7

Member
Aug 2, 2003
18
0
151
replay

Yes,I tried it but still i get the problem.
I think there are some procedure and then delete that perticular command from the .bash_history.

Thank you in advance.

Best regards,
Your Friend.