Is there a way to make mv create the directory to be moved to if it doesn’t exist?

So, if I’m in my home directory and I want to move foo.c to ~/bar/baz/foo.c , but those directories don’t exist, is there some way to have those directories automatically created, so that you would only have to type mv foo.c ~/bar/baz/ and everything would work out? It seems like you could alias mv to … Read more