Khwooo’s Weblog

August 30, 2005

如何清空檔案?

Filed under: freebsd — khwooo @ 10:27 pm

又遇到了一個龐大的log檔案,要清空它最笨的辦法是刪除它,然後再touch一個,真麻煩,複習一下以前貼在這裡的東西:

> 請教各位高手,我有一記錄檔 放在 /var/log/XXX-access_log
> 超過 1G…
> 想用NULL 指令去清除,我是新手,請教一下如何下指令…
> NULL 檔案在那?
> 另外我想要定時清除?要如何設定?

cp /dev/null /var/log/XXX-access_log

快又簡單 🙂

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: