🐧 How to find all files with 777 permissions on Linux

Correct file permissions are the most important part of managing your Linux system.

The file with the 777 resolution is open for everyone to read and write.

Any user logged in can write to this file.

This can be very dangerous for your system.

In some cases, you may need to use 777 permissions, for example for a log file, etc.

But in most cases we don’t need this.

This guide will help you find 777 files on your Linux / Unix system using the find command.

find /path/to/dir -perm 777 

The -perm command line parameter is used with the find command to find files based on permissions.

You can use any permissions instead of 777 to search for files with only these permissions.

For example, to find all files with privileges 777 in the home directory of the logged in user, type:

find $HOME -perm 777 

The above command will search all files and directories with 777 privileges in the specified directory.

But if you do not want to include directories in this list, specify the type using the -type command line parameter, as shown below. The command will only search for files with privileges 777 in the / var / www directory.

find /var/www -perm 777 -type f 

To search only directories, enter:

find /var/www -perm 777 -type d 

Hopefully this guide will help you find permissions based files and secure your Linux / Unix system.

Sidebar