Giving credit to the programmers of GPARTED(8)
gparted works its magic, by entering correct parameters to a suite of partition control & editing commands, which are sh envoked, so you can easily manipulate your partitions on all your SSDs HDDs from the comfort of your UI
When you want to batch manipulate partitions, you can study the log output and make sh scripts yourself, controlling partitions anywhere.
You also have the convenience of running gparted from sh so it still works its magic for you, without the UI!
I usually run cfdisk gdisk fdisk when I partition a fresh mechanical or SSD, later on I invoke gparted when I want to resize or move them
it also runs important commands at the end so that the kernel gets to know your new partition layout, which makes rebooting your machine to use them unneeded
I shrunk and resized a partition where I installed a program, which needed 75GB (*1024!) as installation space but only uses 56GB in the end. I left 12GB of breathing room on the partition after the shrink and of course grew the partition before with the same size, minus the alignment snip of 1MB
log:
myserver kernel: JFS: nTxBlock = 8192, nTxLock = 65536
myserver kernel: SGI XFS with ACLs, security attributes, realtime, scrub, repair, quota, debug enabled
myserver kernel: sdb: sdb1 sdb2 sdb3 sdb4
myserver kernel: sdb: sdb1 sdb2 sdb3 sdb4
^Z
@altbot
https://gparted.org