While shrinking virtual disks is very functional using VMware tools from the guest machine while it is running, from time to time it may be convenient to do it offline, from command line. Here's the procedure to do that (linux host, windows guest):
First we have to mount the virtual disk on the host machine, to prepare it for shrinking:
vmware-mount vmachine.vmdk /mnt
If your guest is also windows OS, you need to make sure that you have ntfs-3g installed on your system. Most linux distributions nowadays have it enabled by default.