Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Just cd into the directory and run the ls -al command.. which should give the full size of each file in the output unless you wanted something totally different.
you should just use the du command such as :
du /var/log
or in human readable numbers
du -h /var/log
or use it on specific files such as :
du -h /var/log/maillog*
and with the command your using you can pipe it to less such as :
ls -laR | less
and the first line to the left will show the total amount in size ...
or again you can use "h" such as :
ls -laRh | less to get it in "human readabe" numbers (MB) ...
so instead of seeing lets say :
1176K
you will see
1.2MB when using -h
ok lemme get something straight... you say its 18megs, but du tells you its 48K ???
whats it gonna be ?
anyways just to resolve ... just truncate the file by typing : > /var/log/lastlog
and it being that size has something to do with sparse files ...
you can read the cp man pages, or do a google search for "sparse files" to read up more about it ...
I am not to sure about du since I have never used it, but I would not be worried about a log file that is 18M thats not to big at all and as a matter of fact its the exact same size as the last log on one of my RH 9 machinces.
Besides most logs only have problems when they get to be around 2 gigs, like apache logs and what not.
well although 18MB isn't overly a huge amount, it is for some logs ....
but the thing is, if you are reaallllly hurting for some harddrive space then you can truncate the file with the command i shown above ....
After searching the forums, I came across this thread. I read that clearing the lastlog file won't hurt anything, but there is a slight difference in my lastlog size that has me curious.
The server has a 20G drive, but the lastlog file reports as 1.2T. I tried to run logrotate on it, and as it copied data, it filled the drive. How does it get real data from a file that is obviously reporting an incorrect size?
I ended up deleting the attempted backup of lastlog and read up on exactly what lastlog does in these forums and the man page, but I'm still boggled at how the file reports larger than the drive.
Is the system that controls lastlog faulty / buggy? (is it ripe for an attack of some sort?)
How does /var/log/lastlog differ from /var/log/secure?
Thanks
Laura
I apologize if I should've started a new thread, but the thread titled "read this before you post in this forum" seemed to make it perfectly clear that if you're furthering an existing conversation, to add to existing threads and only as a last resort start your own.
How does /var/log/lastlog differ from /var/log/secure? Secure is a logfile where you will find sudo logins, ssh logins, failed and successful root logins.
How does /var/log/lastlog differ from /var/log/secure? Secure is a logfile where you will find sudo logins, ssh logins, failed and successful root logins.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.