A partition manipulation program.

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

# To start to manipulate disk partition:
sudo parted </dev/sdX>

# To create a new partition table of label-type directly, label-type can be gpt, msdos etc:
sudo parted --script </dev/sdX> mklabel <gpt>

# To show disk partition information in interactive mode:
print

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

# To interactively create a 16GB partition with a given filesystem:
mkpart <primary|logical|extended> <filesystem> <0%> <16G>

# To resize partition size:
resizepart </dev/sdXN> <end_position_of_partition>

# To remove partition:
rm </dev/sdXN>