Linux - NewbieThis 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!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I don't mind a few lines of reboots, but this is getting rather long:
Last login: Tue May 24 11:24:31 2011
Rebooted at 10:14AM 03/25/10 2.6.18-164.el5
Rebooted at 11:13AM 04/22/10 2.6.18-164.el5
Rebooted at 10:54AM 06/01/10 2.6.18-164.el5
Rebooted at 16:19PM 08/12/10 2.6.18-164.el5
Rebooted at 17:02PM 08/16/10 2.6.18-164.el5
Rebooted at 10:38AM 08/19/10 2.6.18-164.el5
Rebooted at 10:46AM 10/05/10 2.6.18-164.el5
Rebooted at 13:21PM 11/11/10 2.6.18-164.el5
Rebooted at 17:35PM 12/15/10 2.6.18-164.el5
Rebooted at 18:55PM 02/16/11 2.6.18-164.el5
Rebooted at 14:01PM 02/17/11 2.6.18-164.el5
Rebooted at 14:27PM 02/21/11 2.6.18-164.el5
Rebooted at 10:57AM 05/23/11 2.6.18-164.el5
Rebooted at 11:05AM 05/23/11 2.6.18-164.el5
How can I clear (or reduce) the history that comes up when ssh to my host?
You can just change the 'last reboot' in your profile to specify the number of entries you want to see. For example, 'last -n3 reboot'. You can change your /etc/logrotate.conf to reduce the rotation interval for /var/log/wtmp, if you just want to keep less data.
Remember this will clear up all history because you are renaming the file (wtmp is the file use to log reboot, login etc history) using the above command and at the same time you are creating a new one for future logging.
Thank you, but need more information. Where do I change 'last reboot' in my profile?
Most distributions don't list the last reboot. If you or someone you know didn't add it, you'll need to look around to see where it was added. The possible locations vary with the shell. If you're using bash, then check:
and the files in /etc/profile.d/
I tried it once again on my RHEL and Linux Mint system and it worked perfectly fine. You can give a try by breaking down the commands. Run them in the following sequence and see if you still get the message:
1. mv /var/log/wtmp /var/log/wtmp.old
2. ls -l | grep /var/log/wtmp (just to make sure that the file has been renamed)
3. touch /var/log/wtmp
4. chown root.utmp /var/log/wtmp
5. chmod 664 /var/log/wtmp
Last edited by T3RM1NVT0R; 05-24-2011 at 05:56 PM.
No error, as you can see from the files listed, it worked. I used sudo to run the commands, as I do not have permissions as user. I have a new wtmp file that is 1.5k in size, compared with the old file that is 812k.
my.desktop% ls -ltr wtmp*
-rw-rw-r-- 1 root utmp 812160 May 24 13:21 wtmp.old
-rw-rw-r-- 1 root utmp 1536 May 24 14:24 wtmp
I can even view the wtmp.old file and see the binary that looks like it logged the reboots, while the new wtmp file doesn't have much in there yet.