-O FILE (conditional operator)

true if the file exists and is owned by the effective user ID.

-O is not included in POSIX.1-2017.

Examples

Different ways to test if a file is owned by the effective user ID:
1
2
3
4
test -O ~/file && echo "owned by euid"
[ -O ~/file ] && echo "owned by euid"
# Bash
[[ -O ~/file ]] && echo "owned by euid"
BashSupport Pro ist eine Bash IDE mit Unterstützung für -O – probieren Sie es aus!
© 2020–2022 Joachim Ansorg
Impressum
Datenschutz
Rechtliches