Find all immutable files & folders in web folder?

how can I find (lsattr) which files or folders have an immutable status?
e.g. check all files and folders in /var/www

man lsattr:

       -R     Recursively list attributes of directories and their contents.

       -V     Display the program version.

       -a     List all files in directories, including files that start with `.'.

       -d     List directories like other files, rather  than  listing  their  con‐

       -l     Print the options using long names instead of single character abbre‐

       -p     List the file's project number.

       -v     List the file's version/generation number.

-R might be useful.


I suspect jonathon’s hint has already helped you out, but just in case …

lsattr -Rl /var/www 2>&1 | grep Immutable | cut -d' ' -f1

1 Like