list_ntfs.sh
311 Bytes
#!/bin/bash
# Outputs, separated by newlines, the list of NTFS volumes present on this computer
for disk in $(cat /proc/partitions | awk -F " " '{print $NF}' | tail -n+3); do
HEADER=$(dd if="/dev/$disk" bs=1 skip=3 count=4 2> /dev/null)
if [[ $HEADER == "NTFS" ]]; then
echo $disk
fi
done