bisvarup mukherjee

File Permission and RWS

Table of Contents

File Permissions

_ rwx rwx rwx
1 2 3 4
File or directory _ or d Owner's permission Group's permission All other users' permission

Details

r w x
read (4) write (2) execute (1)

so 777 means rwx rwx rwx



Find Files

find / -perm -400

Find all files with permission atleast 400

Count number of results

find / -perm -400 | wc -l

wc -l => count number of lines wc -w => count number of words


Discard Errors

find / -perm -400 2>/dev/null | wc -l

2 means error responses, move them to /dev/null

rws This means if the file has permissions to run as user1 and user2 has access to this file when user2 runs file will run as user1

#linux #file-permissions
Copyright © 2020 Bisvarup Mukherjee
counter freeViews