-N FILE (conditional operator)

true if the file exists and has been modified since it was last read.

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

Examples

Different ways to test if a file was modified since it was last read:
1
2
3
4
test -N ~/file && echo "modified"
[ -N ~/file ] && echo "modified"
# Bash
[[ -N ~/file ]] && echo "modified"
BashSupport Pro 是一个 支持 -N 的 Bash 集成开发工具 – 马上试用
© 2020–2024 Joachim Ansorg
声明
隐私政策
许可条款