Displaying the Partitions & File-System
Hello all,
I intend to write a shell script that will display the partitions & the respective file-systems. So I am planning to write a Shell Script as given below: #!/bin/bash fdisk /dev/sda But My problem is that when I execute the above script, I am required to enter the "p" manually to display the partition table How can I automate that so that I don't need to enter "p" manually. |
fdisk already does what you want with the -l option (man fdisk):
fdisk -l /dev/sda If you pipe the output to a file, you can parse it with sed and awk. |
All times are GMT -5. The time now is 02:37 PM. |