One handy idiom I like to use after typing out a long command that I might want to save is
echo ‘!!’ > ~/bin/name-of-script
where !! is the previous command echo ‘!!’ > ~/bin/name-of-script
where !! is the previous commandNo comments yet.