How to protect your files from deletion

I wrote about this before, but its important enough to write twice

How to revoke write permissions to a directory

How to revoke your own user permissions 

$ chmod u-w dirname

How to delete all permissions from anyone on your system 

$ chmod a-w dirname

removing write access on a file does not stop it from being removed,

you must remove write access to the directory to protect the file from deletion – Ice Bear

How to test this

To test this, simple change the permissions and try to $ rm any_file_name. You can even rmdir dirnameand it will protect the directory from deletion

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s