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

31 lines
550 B
Bash

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