The Ctrl-x-e key sequence provides a quick and easy way to save commands you've recently used on the command line into files.