On Wed, Jul 25, 2012 at 12:14 AM, Wybo Dekker <email@example.com> wrote:
> When I create a file in my home directory as root:
> $ sudo touch test
> I get:
> $ ls -l test
> -rw-r--r-- 1 root root 0 2012-07-24 18:09 test
> I cannot, without sudo, overwrite this file, but I can remove it with rm
> -rf. Is that correct? And if not: how can I find out what's wrong with
> my system?
rm does not change data inside the file, or the inode data that tells
the system where the file data is. It only changes the directory
info that associates a name with that inode number.
Therefore, for rm to work you need write access for the directory,
not for the file. This may be a bit counter-intuitive, but it has
been standard for any Unix variant since before I learned it in
the early 80s.
xubuntu-users mailing list
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/xubuntu-users