Sunday, 13 December 2015

Search Files Based On PERMISSION In Unix/Linux

In this article, We will see how find search the files based PERMISSION criteria, say files  PERMISSION is 777 or 644 or 555 etc. This can be done with the find command options available. Before you start this article please go through the following article Basics of FIND Command In Unix/Linux for basics if you have already not followed.

SYNTAX:
find <path> -perm [PERMISSION]


Find Files With 777 Permissions
$ find . -type f -perm 777
Output: Will list down all the files which have permission as 777.


Find Files Without 777 Permissions
$ find . -type f ! -perm 777
Output: Will list down all the files which do not have permission as 777.


At the same time we can search directories as well by using -type d switch which we have already seen in previous pots/article.

Find Directories with 777 Permissions
$ find . -type d -perm 777
Output: Will list down all the directories which have permission as 777.


Find Directories without 777 Permissions$ find . -type d ! -perm 777Output: Will list down all the directories which do not have permission as 777.

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...