7. Find Files With 777 Permissions
Find all the files whose permissions are 777.# find . -type f -perm 0777 -print
8. Find Files Without 777 Permissions
Find all the files without permission 777.# find / -type f ! -perm 777
9. Find SGID Files with 644 Permissions
Find all the SGID bit files whose permissions set to 644.# find / -perm 2644
10. Find Sticky Bit Files with 551 Permissions
Find all the Sticky Bit set files whose permission are 551.# find / -perm 1551
11. Find SUID Files
Find all SUID set files.# find / -perm /u=s
12. Find SGID Files
Find all SGID set files.# find / -perm /g+s
13. Find Read Only Files
Find all Read Only files.# find / -perm /u=r
14. Find Executable Files
Find all Executable files.# find / -perm /a=x
15. Find Files with 777 Permissions and Chmod to 644
Find all 777 permission files and use chmod command to set permissions to 644.# find / -type f -perm 0777 -print -exec chmod 644 {} \;
16. Find Directories with 777 Permissions and Chmod to 755
Find all 777 permission directories and use chmod command to set permissions to 755.# find / -type d -perm 777 -print -exec chmod 755 {} \;
17. Find and remove single File
To find a single file called howtolinux247.txt and remove it.# find . -type f -name "howtolinux247.txt" -exec rm -f {} \;
18. Find and remove Multiple File
To find and remove multiple files such as .mp3 or .txt, then use.# find . -type f -name "*.txt" -exec rm -f {} \; OR # find . -type f -name "*.mp3" -exec rm -f {} \;
19. Find all Empty Files
To file all empty files under certain path.# find /tmp -type f -empty
20. Find all Empty Directories
To file all empty directories under certain path.# find /tmp -type d -empty
21. File all Hidden Files
To find all hidden files, use below command.# find /tmp -type f -name ".*"
Good Luck For You!!
0 comments:
Post a Comment