Bascially you want a file, like a log, that had tons of data in it, to have all
the data removed, but there still be a log file there?  Does that sound about
right?

What I would do, would be delete the file

rm -f file.log

And then to get the file there again, with the bit size of 0 (zero) I'd use the
touch command.

touch file.log

If you then get a ls -la on the file, it will give you this.

[timh@r2d2 timh]$ touch file.log
[timh@r2d2 timh]$ ls -la file.log
-rw-r--r--    1 timh     timh            0 Jul  9 08:09 file.log


That's how I would go about it.  Others would open the file in NEdit and then
just delete everything and save it.  All depends on how ya want to go about
doing it.
tdh

--
T. Holmes
-----------------
UNIXTECHS.org
[EMAIL PROTECTED]
-----------------
"Real Men Us Vi!"

Uptime:
  --------------------------------------------------------------------
 8:08AM  up 4 days, 11:15, 5 users, load averages: 0.01, 0.05, 0.02
  --------------------------------------------------------------------
                        Your Fortune
"Of course it's the murder weapon.  Who would frame someone with a fake?"

| * Craig Westerman <[EMAIL PROTECTED]> [010708 23:47]:
| >    Is there a linux command that will remove the contents of a file, but
| >    leave the file name?
| 
| To "empty" a text file named file.txt, I would do:
| 
| $ cp /dev/null file.txt
| 
| There are probably quite a few other ways to do it.
| 
| -- 
| Jan Wilson, SysAdmin     _/*];          [EMAIL PROTECTED]
| Corozal Junior College   |  |:'  corozal.com corozal.bz
| Corozal Town, Belize     |  /'  chetumal.com & linux.bz
| Reg. Linux user #151611  |_/   Network, SQL, Perl, HTML
| 
| 
  ------------------------------------------------------------------ 

Reply via email to