-b FILE (conditional operator)

true if the file is a block special file. Such a file is also known as “block device”.

Examples

Different ways to test if a file is a block special file:
1
2
3
4
test -b /dev/sda && echo "block device"
[ -b /dev/sda ] && echo "block device"
# Bash
[[ -b /dev/sda ]] && echo "block device"
BashSupport Pro ist eine Bash IDE mit Unterstützung für -b – probieren Sie es aus!
© 2020–2022 Joachim Ansorg
Impressum
Datenschutz
Rechtliches