Linux.com

Home Linux Community Forums Software Command Line Remove read only files and directories (Ubuntu)

Remove read only files and directories (Ubuntu)

Link to this post 24 Mar

Howdy,

I have several read only files and folders among many others writable files and folders.

My question: is there a way to delete all the read only files and folders through one commande line instead of deleting them one by one ?

Thanks from Begueradj B.

Link to this post 06 Apr

yes, search all files with readonly perm, and delete them recursive.

find . -type f -perm 0400

Link to this post 18 Apr

shgurbanov said:

yes, search all files with readonly perm, and delete them recursive.

find . -type f -perm 0400

Thank you.

Link to this post 27 May

find / -type f -perm 0400 -exec rm\{};

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board