Linux provides a command-line utility rm that has the purpose ofremoving a file from a directory. When
Fantastic news! We've Found the answer you've been seeking!
Question:
Linux provides a command-line utility rm that has the purpose ofremoving a file from a directory.
When executing rm inside of the strace utility we can see thatrm makes a system call to unlink().
Here is an example.
$ strace rm test.txt
... unlinkat(AT_FDCWD, "test.txt", 0) = 0
Question :
Explain why rm unlinks the file. How does unlinkingresult in the removal of the file? and
Why does Linux not have a system call such as delete()that rm could use to directly remove the file?
Related Book For
Value at Risk The New Benchmark for Managing Financial Risk
ISBN: 978-0071464956
3rd edition
Authors: Philippe Jorion
Posted Date: