No modo Emacs, digite sudo $(locate create-tables.sql)
, Esc , Controle + e
Veja shell-expand-line
em Manual de referência do bash :
Expand the line as the shell does. This performs alias and history expansion as well as all of the shell word expansions