rwx/sh/alias/lsblk.sh
2024-11-19 14:42:11 +01:00

31 lines
542 B
Bash

# list block devices
lb() { a__list_block "${@}"; }
a__list_block() {
a__list_block_output \
"SIZE" \
"TYPE" \
"FSTYPE" \
"LABEL" \
"MOUNTPOINTS" \
"${@}"
}
# base arguments
lbne() { a__list_block_no_empty "${@}"; }
a__list_block_no_empty() {
lsblk \
--noempty \
"${@}"
}
# output arguments
lbo() { a__list_block_output "${@}"; }
a__list_block_output() {
local argument
local arguments="NAME"
for argument in "${@}"; do
arguments="${arguments},${argument}"
done
a__list_block_no_empty \
--output "${arguments}"
}