-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 -bprobieren Sie es aus!
© 2020–2024 Joachim Ansorg
Impressum
Datenschutz
Rechtliches