-G FILE (conditional operator)
true
if the file exists and is owned by the effective user ID.
-G
is not included in POSIX.1-2017.
Links
Examples
- Different ways to test if a file is owned by the effective group ID:
1 2 3 4
test -G ~/file && echo "owned by egid" [ -G ~/file ] && echo "owned by egid" # Bash [[ -G ~/file ]] && echo "owned by egid"
BashSupport Pro is a Bash IDE with support for -G – try it now!