Whenever I log in to my terminal and execute some cmds and then I type "history", I get the list of all the commands that I have executed.
I want to know where is the history been stored (any path location ?)
Secondly,if I want to delete the history or some part of the history, can I do it ? If yes, how?
Generally you dont have permission for execute this operations, only a Superuser. Search your ./bash_history if you have bash, and delete them if you can.
In KSH, the the location of the history file is based on the HISTFILE variable. Usually, you set this variable to your home directory.
ie. HISTFILE=~/.history
I got the file .. mine is in bash so I got the .bash_history file
I removed the contents of the file.
hyper20:~ 22> cat .bash_history
hyper20:~ 23>
but then when I agian type the command history :- it is still showing the history of commands executed
==========
hyper20:~ 23> history
1 1:53 showbl
2 2:05 cd
3 2:05 while [1]
4 2:10 while {1}
5 2:10 while [ 1 ]
6 2:13 pwd
7 2:13 cd
8 2:14 ls -a
9 2:14 vi .bash_history
10 2:14 ll .bash_history
11 2:16 env | grep HISTFILE
12 2:16 env
13 2:17 ls -a
14 2:18 vi .bash_history
15 2:18 history
16 2:18 vi .bash_
17 2:18 vi .bash_history
18 2:19 vi .bashrc
19 2:19 vi .viminfo
20 2:19 history
21 2:19 ll -a
22 2:19 cat .bash_history
23 2:20 history
Could you please help me in this as to how still I am getting the history ?
I got the file .. mine is in bash so I got the .bash_history file
I removed the contents of the file.
hyper20:~ 22> cat .bash_history
hyper20:~ 23>
but then when I agian type the command history :- it is still showing the history of commands executed
==========
hyper20:~ 23> history
1 1:53 showbl
2 2:05 cd
3 2:05 while [1]
4 2:10 while {1}
5 2:10 while [ 1 ]
6 2:13 pwd
7 2:13 cd
8 2:14 ls -a
9 2:14 vi .bash_history
10 2:14 ll .bash_history
11 2:16 env | grep HISTFILE
12 2:16 env
13 2:17 ls -a
14 2:18 vi .bash_history
15 2:18 history
16 2:18 vi .bash_
17 2:18 vi .bash_history
18 2:19 vi .bashrc
19 2:19 vi .viminfo
20 2:19 history
21 2:19 ll -a
22 2:19 cat .bash_history
23 2:20 history
Could you please help me in this as to how still I am getting the history ?