-g FILE (conditional operator)
true if the file exists and its set-group-id bit is set, i.e. the SETGID bit.
false if the file does not exist or does not have the SETGID bit set.
-u is for the set-user-id bit.
Links
Examples
- Different ways to test if a file has the SETGID bit set:
1 2 3 4test -g ~/bin/cmd && echo "SETGID set" [ -g ~/bin/cmd ] && echo "SETGID set" # Bash [[ -g ~/bin/cmd ]] && echo "SETGID set"- Set the
SETGIDbit 1chmod g+s /usr/local/bin/my-cmd
BashSupport Pro ist eine Bash IDE mit Unterstützung für -g – probieren Sie es aus!