Results 1 to 4 of 4

Thread: Clear the history command in Linux

  1. #1
    Join Date
    Nov 2010
    Posts
    19

    Clear the history command in Linux

    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:04 PM.

  2. #2
    Join Date
    May 2008
    Posts
    681

    Re: Clear the history command in Linux

    # 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.

  3. #3
    Join Date
    Nov 2009
    Posts
    758

    Re: Clear the history command in Linux

    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

  4. #4
    Join Date
    May 2008
    Posts
    991

    Re: Clear the history command in Linux

    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
    $

Similar Threads

  1. Command Line in Linux to clear the /tmp folder
    By BBC123 in forum Operating Systems
    Replies: 4
    Last Post: 26-02-2012, 02:11 PM
  2. How to Clear Browser History
    By hatemsalah in forum Tips & Tweaks
    Replies: 3
    Last Post: 23-03-2010, 08:35 AM
  3. Linux history command and fc command
    By Alkesh jain in forum Operating Systems
    Replies: 3
    Last Post: 26-05-2009, 07:23 PM
  4. How to clear history for a particular website ?
    By Ronchi in forum Technology & Internet
    Replies: 3
    Last Post: 12-05-2009, 11:52 AM
  5. To Clear History in Netscape
    By Computer_Freak in forum Tips & Tweaks
    Replies: 3
    Last Post: 16-03-2009, 02:34 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,638,765,539.32607 seconds with 17 queries