Created
June 15, 2013 01:48
-
-
Save jcordeiro/5786445 to your computer and use it in GitHub Desktop.
Just a small shell file I had to write for my OS class that goes through the first 4 disks on a linux system and prints out the number of partitions they have.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "The following hard disks are currently present in your system:" | |
for DISK in /dev/sda /dev/sdb /dev/sdc /dev/sdd | |
do | |
echo "The disk $DISK appears to have `fdisk -l $DISK 2> /dev/null | grep -E $DISK\[0-9]\ | wc -l` partitions." | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment