LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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
 
LinkBack 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?
 
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: 56
Run the command: >/var/log/wtmp
man last
 
Old 12-03-2008, 09:27 AM   #6
chitambira
Member
 
Registered: Oct 2008
Location: Fife
Distribution: RHEL, Centos
Posts: 373
Blog Entries: 1

Rep: Reputation: 49
#rm -f /var/log/wtmp && touch /var/log/wtmp
#chown root.utmp /var/log/wtmp && chmod 664 /var/log/wtmp
 
1 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: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,512
Blog Entries: 27

Rep: Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174
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: Ubuntu, Debian, Fedora
Posts: 21

Rep: Reputation: 0
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: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,512
Blog Entries: 27

Rep: Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174
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: Ubuntu, Debian, Fedora
Posts: 21

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are 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/Novell 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


All times are GMT -5. The time now is 11:34 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration