Edit and execute a command on the unix command line from vim

Sometimes I type or paste a lot of text on the command line and there is a small error right in the middle. Sometimes I’ve run a command but I need to run it again but replace a word multiple times. There are a number of ways to quickly solve this issue, but since I’m handy with vim I choose to edit the command in vim and execute it.

Tools:

  • 1 ea unix

1From the unix command line hit ctrl + x, e

ctrl + x, e
While holding the control key, hit ‘x’ and then ‘e’. This will bring up the current command in your default text editor.

Note:

Keep the ctrl key pressed while you press and release ‘x’ and ‘e’.


Now learn about:


Discuss this guide

var disqus_shortname = ‘howchootest’; (function() { var dsq = document.createElement(‘script’); dsq.type = ‘text/javascript’; dsq.async = true; dsq.src = ‘//’ + disqus_shortname + ‘.disqus.com/embed.js’; (document.getElementsByTagName(‘head’)[0] || document.getElementsByTagName(‘body’)[0]).appendChild(dsq); })();

Tools:

  • 1 ea unix

Leave a Reply

Your email address will not be published. Required fields are marked *