LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 09-01-2005, 09:57 PM   #1
nistelrooy
Member
 
Registered: Oct 2003
Location: Singapore
Distribution: debian
Posts: 162

Rep: Reputation: 30
clear history "last" command


How do i clear all last login history?
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 09-01-2005, 10:02 PM   #2
shadowsurfer
Member
 
Registered: Aug 2004
Location: philippines
Posts: 51

Rep: Reputation: 15
try this command

history -c
 
Old 09-01-2005, 10:03 PM   #3
shadowsurfer
Member
 
Registered: Aug 2004
Location: philippines
Posts: 51

Rep: Reputation: 15
sorry wrong command
 
Old 10-17-2005, 03:53 AM   #4
nistelrooy
Member
 
Registered: Oct 2003
Location: Singapore
Distribution: debian
Posts: 162

Original Poster
Rep: Reputation: 30
any idea?
 
Old 10-17-2005, 06:36 AM   #5
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
Run the command: >/var/log/wtmp
man last
 
Old 12-03-2008, 09:27 AM   #6
chitambira
Member
 
Registered: Oct 2008
Location: Online
Distribution: RHEL, Centos
Posts: 373
Blog Entries: 1

Rep: Reputation: 51
#rm -f /var/log/wtmp && touch /var/log/wtmp
#chown root.utmp /var/log/wtmp && chmod 664 /var/log/wtmp
 
2 members found this post helpful.
Old 11-03-2010, 11:22 AM   #7
b4big
LQ Newbie
 
Registered: Jul 2009
Posts: 1

Rep: Reputation: 0
Smile remove or clear the last login information

Display last login information
$ lastlog

Output
Username Port From Latest
root tty1 Thu Jan 25 15:23:50 +0530 2007
daemon **Never logged in**
bin **Never logged in**
sys **Never logged in**
sync **Never logged in**
vivek tty1 Sat Jan 27 22:10:36 +0530 2007
pdnsd **Never logged in**
sshd **Never logged in**
messagebus **Never logged in**
bind **Never logged in**
sweta tty1 Sat Jan 27 19:55:22 +0530 2007


To Clear last login information Simply overwrite /var/log/lastlog file. You must be the root user. First make a backup of /var/log/lastlog:
# cp /var/log/lastlog /root

Now overwrite file using any one of the following command:
# >/var/log/lastlog

OR
# cat > /var/log/lastlog
Press CTR+D

OR
# vi /var/log/lastlog
delete the contents of file and
# :wq

Last edited by b4big; 11-03-2010 at 11:24 AM.
 
Old 11-03-2010, 11:38 AM   #8
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by chitambira View Post
#rm -f /var/log/wtmp && touch /var/log/wtmp
#chown root.utmp /var/log/wtmp && chmod 664 /var/log/wtmp
Interesting; the chown man page has chown [OPTION]... [OWNER][:[GROUP]] FILE... but chown root.utmp <some file> works just fine.
 
Old 11-03-2010, 11:47 AM   #9
alanv
LQ Newbie
 
Registered: Jun 2010
Distribution: Fedora
Posts: 24

Rep: Reputation: 1
Sorry to interrupt, but this post has just been posted but already has more than 20000 views! Is it a bug in my web browser?
 
Old 11-03-2010, 11:59 AM   #10
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by alanv View Post
Sorry to interrupt, but this post has just been posted but already has more than 20000 views! Is it a bug in my web browser?
No, it's a Lazarus job -- the thread was started in 2005.
 
Old 11-03-2010, 12:09 PM   #11
alanv
LQ Newbie
 
Registered: Jun 2010
Distribution: Fedora
Posts: 24

Rep: Reputation: 1
Oh, I see. I should have looked at the date more carefully.
 
  


Reply



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
New SQUID user: How to clear the "access.log" and "store.log" automatically? yuzuohong Linux - Networking 2 12-02-2006 05:37 AM
how do i replace the clear "clear screen" with the cls command thefedexguy SUSE / openSUSE 2 12-02-2005 05:02 PM
history clear command suguname Linux - Newbie 5 03-05-2005 09:32 AM
Tiny Sofa 2.0 - I thought "halt", "reboot" were only root command ?? sorcerer Linux - Distributions 1 08-21-2004 03:28 PM
How to find back "history" database after "history -c" ? san_lss Linux - Newbie 1 01-07-2004 11:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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