let say you want to delete all docker images with name none.
here is how you would do it.
docker images -a | grep "<none>" | awk '{print $3}'
$3 select the 3rd column of the table dumped on terminal if you run docker images command . which is Image Id.
And now since you have image id you can remove them all together like this:
docker rmi `docker images -a | grep "<none>" | awk '{print $3}'`
Likewise what if you want to unmount the drive from USB
if you run df -h the first column is the mounted device, so to select that we would do awk '{print $1}' and unmount
sudo umount -f `df -h | grep "pattern/disk name" | awk '{print $1}'`
thats it. pretty useful.