cat /dev/null > file.log does not truncate large file in Darwin
In the past, on linux systems, I’ve been able to truncate large, open log files (that is, a file that is being actively written to by a process) using cat /dev/null > file.log.
In the past, on linux systems, I’ve been able to truncate large, open log files (that is, a file that is being actively written to by a process) using cat /dev/null > file.log.
In Mac OS X, if I don’t touch it for a while, it will lock the screen and one must use password to unlock it, but this kind of log in is not recorded by last command. I want to know if anybody tried to break into my MacBook when I am not in front of it. Is there any way I can log such attempts?
I am running a daemon process that will have to run indefinitely (a ‘service’ so to speak) and wish to log its output. A simple solution like:
Usually I use tail -f /var/log/messages to get updates if there are new lines.