-p FILE (conditional operator)

true if the file exists and is a named pipe (also known as a FIFO).

Examples

Different ways to test if a file is a named pipe:
1
2
3
4
test -p ~/file && echo "named pipe"
[ -p ~/file ] && echo "named pipe"
# Bash
[[ -p ~/file ]] && echo "named pipe"
BashSupport Pro is a Bash IDE with support for -ptry it now!
© 2020–2026 Joachim Ansorg
Imprint
Privacy Policy
Legal