How do I mount a block device using only one command?
Such as mount sdb1 (create and select directory automatically)
or mount sdb1 /mnt/USB1/. (create directory automatically in one step.)
Linux sometimes does not mount automatically.
How do I mount a block device using only one command?
Such as mount sdb1 (create and select directory automatically)
or mount sdb1 /mnt/USB1/. (create directory automatically in one step.)
Linux sometimes does not mount automatically.
Add a function to the shell initialization file of your choice:
function qmount() {
# qmount DEVICE DIR
sudo sh -c 'mkdir -p "/mnt/$2" && mount "/dev/$1" "/mnt/$2"' sh "$1" "$2"
}