Nice, note that you can use the following one-liners too:
# Remove all dangling images (unused images)
$ docker rmi $(sudo docker images -q -f "dangling=true")
# Remove all dangling volumes (unused volumes)
$ docker volume rm $(docker volume ls -q -f "dangling=true")