Re: Is file deleted imidiately after firing rm command?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thursday 09 June 2005 03:11, Dipti Pawar wrote:
> Hi
> After firing the rm filename command is the file deleted immediately by
> kernel or
>  does it lists such files and then delete them from system after a some
> specific interval?

The 'rm' command (or unlink() system call, which it uses) just removes
the file *name* and decrements a reference count on the inode of the
file.  Only when the reference count goes to 0 is the inode freed.
The reference count includes hard links in the filesystem as well as all
open()ed and mmap()ed references as well.

When the inode is freed, there will still be some delay before that
change gets propagated to the disk.

As for the shred command that was mentioned, it won't work very
well on certain types of filesystems (e.g. ones that use a Journal).
The manpage has more restrictions.

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux