[Top][All Lists]

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

Re: What is the difference between unlink and rm -f?

From: David Both
Subject: Re: What is the difference between unlink and rm -f?
Date: Wed, 29 Jan 2020 07:54:16 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1

They are effectively the same. The rm command simply removes the specified link. However the file is not truly deleted until all of the hard links to it have been deleted.

I discuss links and hard links extensively in Chapter 18 of my book, /Using and Administering Linux: Volume 1 -Zero to SysAdmin: Getting Started <>./

On 1/29/20 4:45 AM, Peng Yu wrote:

It seems to me unlink and rm -f are the same if the goal is the delete
files. When are they different? Thanks.


David P. Both, RHCE
********************************************************* - My personal web site - Home of the DataBook for Linux
DataBook is a Registered Trademark of David Both
The value of any software lies in its usefulness
not in its price.

— Linus Torvalds

reply via email to

[Prev in Thread] Current Thread [Next in Thread]