rwx/sh/alias/lsblk.sh

32 lines
542 B
Bash
Raw Normal View History

2023-05-14 13:45:02 +02:00
# list block devices
2024-11-19 14:42:11 +01:00
lb() { a__list_block "${@}"; }
a__list_block() {
a__list_block_output \
2024-11-16 15:53:58 +01:00
"SIZE" \
"TYPE" \
"FSTYPE" \
"LABEL" \
2024-11-18 18:50:54 +01:00
"MOUNTPOINTS" \
"${@}"
2024-11-16 15:53:58 +01:00
}
2023-05-13 01:59:08 +02:00
2024-11-16 16:07:47 +01:00
# base arguments
2024-11-19 14:42:11 +01:00
lbne() { a__list_block_no_empty "${@}"; }
a__list_block_no_empty() {
2024-11-16 15:53:58 +01:00
lsblk \
--noempty \
"${@}"
}
# output arguments
2024-11-19 14:42:11 +01:00
lbo() { a__list_block_output "${@}"; }
a__list_block_output() {
2024-11-16 15:53:58 +01:00
local argument
local arguments="NAME"
for argument in "${@}"; do
arguments="${arguments},${argument}"
done
2024-11-19 14:42:11 +01:00
a__list_block_no_empty \
2024-11-16 15:53:58 +01:00
--output "${arguments}"
}