A partition manipulation program.

# To list partitions on all block devices:
sudo parted --list

# To start interactive mode with the specified disk selected:
sudo parted </dev/sdX>

# To create a new partition table of the specified label-type:
sudo parted --script </dev/sdX> mklabel <aix|amiga|bsd|dvh|gpt|loop|mac|msdos|pc98|sun>

# To show partition information in interactive mode:
print

# To select a disk in interactive mode:
select </dev/sdX>

# To create a 16GB partition with the specified filesystem in interactive mode:
mkpart <primary|logical|extended> <btrfs|ext2|ext3|ext4|fat16|fat32|hfs|hfs+|linux-swap|ntfs|reiserfs|udf|xfs> <0%> <16G>

# To resize a partition in interactive mode:
resizepart </dev/sdXN> <end_position_of_partition>

# To remove a partition in interactive mode:
rm </dev/sdXN>