This article is from a FAQ concerning SCO operating
systems. While some of the information may be applicable to any OS,
or any Unix or Linux OS, it may be specific to SCO Xenix, Open
Desktop or Openserver.
There is lots of Linux, Mac OS X and general Unix info elsewhere on
this site: Search this site is the best
way to find anything.
Generally, you can just use the ">" to empty a log file. For example, to clear out /var/adm/syslog, just use:
> /var/adm/sylog
That will empty the file while leaving ownerships and permissions intact.
Sometimes, however, you have a program that keeps the file open while it writes to the log. In such a case, you may need to stop the program, clear the log, and restart.
You can easily check to see if any process is using a file with "fuser":
fuser /var/adm/syslog
will return the pid of syslog. You can combine all this:
ps -p `fuser /var/adm/syslog`
(It's not necessary to stop the syslogd process when clearing syslog)
Enter your email address for automatic notification of new posts here
(be sure to whitelist 'feedburner.com' if you use spam filtering)
| Views for this page | ||||
|---|---|---|---|---|
| Today | This Week | This Month | This Year | Overall |
| 29 | 188 | 276 | 276 | 20,967 |
Have you tried Searching this site?
Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates
This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.
Click here to add your comments