-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.

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 ist eine Bash IDE mit Unterstützung für -Gprobieren Sie es aus!
© 2020–2024 Joachim Ansorg
Impressum
Datenschutz
Rechtliches