[plug] .xsession-errors
Russell Steicke
r.steicke at bom.gov.au
Thu Dec 2 12:10:44 WST 2004
On Thu, Dec 02, 2004 at 11:36:47AM +0800, Matt Kemner wrote:
> On Thu, 2 Dec 2004, quoth Russell Steicke:
>
> > > Should I just rm it and touch a new one?
> >
> > That won't work, because programs in your X session will still have it
> > open for writing, so the space won't be freed even though the file
> > disappears from your home directory. The only way to get rid of it is
> > to log out.
>
> Handy tip: You can truncate files with the > operand
>
> ie bash:~# > .xsession-errors
>
> This will overwrite the file with a 0 length one, instantly saving you the
> space.
Excellent, thank you. Just a warning for others that you have to be
aware that the next time something writes to it at the old file
position (ie an X program that inherits the file descriptor) it
becomes a sparse file (mostly filled with 0 bytes that aren't
allocated on the disk) with apparently the same size it had
previously. So you need to use du to find out how much space is
really allocated.
$ ls -lh .xsession-errors
-rw------- 1 russells russells 77K Dec 2 12:01 .xsession-errors
$ du -h .xsession-errors
8.0K .xsession-errors
$
ext3, at least, supports sparse files. I would guess that reiserfs
and xfs and others do as well, but haven't confirmed that.
--
Russell Steicke
-- Fortune says:
"I have a bone to pick, and a few to break."
-- Anonymous
More information about the plug
mailing list