rwx/sh/alias/lsblk.sh

32 lines
566 B
Bash
Raw Normal View History

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