[lug] Re: Linux command to over write a file with an empty file.
Hello Jdhog
try this command :
cat>file_name.log
this will overwrite you current log.
----- Original Message -----
From: "jdhog" <justind40@vitallease.com>
To: "Linux Users Group" <linuxusersgroup@googlegroups.com>
Sent: Tuesday, January 17, 2006 9:23 AM
Subject: [lug] Linux command to over write a file with an empty file.
> Is there a linux command which will allow me to truncate or over write
> a file to get rid of the original files contents and make it an empty
> file? My situation is that I have a log file that is growing extremely
> fast. When it gets to large, the file script that is writing to the
> file crashes. I tried copying the file to a sub directory and then
> deleting the original file. The script will create a new file if it
> doesn't exists. The problem is that cp and mv commands both seem to
> carry the symbolic link with the copied or moved file and thus the
> script keeps writing to the moved or copied file. Any help would be
> greatly appreciated.
>
>
0 Comments:
Yorum Gönder
<< Home