Access permission tests (GNU Coreutils 9.0)
From Get docs
Coreutils/docs/latest/Access-permission-tests
Next: File characteristic tests, Previous: File type tests, Up: test invocation [Contents][Index]
16.3.2 Access permission tests
These options test for particular access permissions.
- ‘
-g file’ True if
fileexists and has its set-group-ID bit set.- ‘
-k file’ True if
fileexists and has its sticky bit set.- ‘
-r file’ True if
fileexists and read permission is granted.- ‘
-u file’ True if
fileexists and has its set-user-ID bit set.- ‘
-w file’ True if
fileexists and write permission is granted.- ‘
-x file’ True if
fileexists and execute permission is granted (or search permission, if it is a directory).- ‘
-O file’ True if
fileexists and is owned by the current effective user ID.- ‘
-G file’ True if
fileexists and is owned by the current effective group ID.