Thursday, September 21, 2006

zero the log files

what the different between these 2 commands?
# cat /dev/null > /var/log/messages

# > /var/log/messages
both commands zero the /var/log/messages file
but using > will not spawn a new process.
so you'll need to restart syslogd. (only on solaris but not on linux)

3 comments:

Anonymous said...

why do you need to spaw another process? Will the syslogd work after the ">" without restaring the syslogd?

ashamril said...

will not work. nothing will be log unless u restart syslogd after using >, even though syslogd already running... heran gak aku!

Anonymous said...

Jadi kat aku hari tu. Satu hari log tak masuk...sib bak aku check balik kalau tak kena fired dah :D