Few days before I am using Windows XP SP3, but now I am using Linux Operating System. I am very new to this OS. So can any one tell how can i clear all last login history???
Few days before I am using Windows XP SP3, but now I am using Linux Operating System. I am very new to this OS. So can any one tell how can i clear all last login history???
Last edited by Dumpkin; 10-11-2010 at 09:34 PM.
# echo >.bash_history
# vim /etc/profile
……
HOSTNAME=`/bin/hostname`
HISTSIZE=0
if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then
INPUTRC=/etc/inputrc
……
:wq
# exit
I hope above command will help you to solve you problem.
The following method will help you to viewing the terminal history and then optionally clearing the terminal history.
For viewing the complete terminal history:
To view the complete history of commands typed in the terminal "for the logged in user", open the terminal and type history.
For clearing the terminal history:
1.Login with the user account whose terminal history you plan to clear
2.Open a terminal window and type history -c
3.Repeat the process if necessary for each user account
In Linux Operating System bash offers two modes for command editing - emacs mode and vi editor mode. In each of these editing modes the shortcuts for retrieving history are different.
Suppose you had executed the following commands:
$ echo foo bar baz
$ iptables -L -n -v -t nat
$ ... lots and lots more commands
$ echo foo foo foo
$ perl -wle 'print q/hello world/'
$ awk -F: '{print$1}' /etc/passwd
$
Bookmarks