Jump to content

10 Keyboard Shortcuts for Text Navigation & Manipulation in the Command Line


Recommended Posts

Posted

<div class="KonaBody"><p><img src="http://osxdaily.com/wp-content/uploads/2012/02/navigate-text-command-line.jpg" alt="Navigate text in the command line" title="navigate-text-command-line" width="620" height="330" class="aligncenter size-full wp-image-27789" /></p>

<p>We recently covered <a href="http://osxdaily.com/2012/02/23/keyboard-shortcuts-to-navigate-select-text-mac-os-x/">12 keyboard shortcuts</a> to help navigate around and manipulate text in Mac OS X, and now we’ll show you a handful of similar tricks for use at the command line. These shortcuts can be used just about anywhere in the Terminal, including the bash prompt.</p>

<h2 style="font-size:1.2em;">7 Navigation Shortcuts</h2>

<p>Navigate around blocks of texts faster with the following shortcuts:</p>

<ul>

<li><strong>Jump to Beginning of Line</strong> – Control+A</li>

<li><strong>Jump to End of Line</strong> – Control+E</li>

<li><strong>Go to Next Line</strong> – Control+N</li>

<li><strong>Go to Previous Line</strong> – Control+P</li>

<li><strong>Delete Previous Word</strong> – Control+W</li>

<li><strong>Delete Line from Cursor to Beginning</strong> – Control+U</li>

<li><strong>Delete Line from Cursor to End</strong> – Control+K</li>

</ul>

<p>Of course you can also use the arrow keys to navigate within text blocks and to place the cursor for using all commands mentioned.</p>

<h2 style="font-size:1.2em;">3 Cutting & Pasting Shortcuts for the Command Line</h2>

<p>The command line also has it’s own version of cut and paste, called “kill” and “yank”, and you can reuse two previously mentioned commands for this purpose:</p>

<ul>

<li><strong>Cut from Cursor to Beginning of Line</strong> – Control+U</li>

<li><strong>Cut from Cursor to End of Line</strong> – Control+K</li>

<li><strong>Paste Previously Cut Text at Cursor</strong> – Control+Y</li>

</ul>

<p>Because the latter two kill and yank commands do not overwrite the clipboard buffer, they can function as <a href="http://osxdaily.com/2012/02/01/use-a-secondary-cut-and-paste-function-to-avoid-overwriting-clipboard-contents/">a secondary cut & paste</a> command in many GUI based Mac OS X apps as well.</p>

<p>Enjoy this? Check out <a href="http://osxdaily.com/category/command-line/">more command line tips</a> in our archives.</p>

<p><em>Thanks to Josh who pointed out some these commands <a href="http://osxdaily.com/2012/02/23/keyboard-shortcuts-to-navigate-select-text-mac-os-x/#comment-342592">in the comments</a></em></p>

</div>

<p><a href="http://feedads.g.doubleclick.net/~a/Z9qQg6juFN040HqIARHuItnJ7Ws/0/da"><img src="http://feedads.g.doubleclick.net/~a/Z9qQg6juFN040HqIARHuItnJ7Ws/0/di" border="0" ismap="true"></img></a><br/>

<a href="http://feedads.g.doubleclick.net/~a/Z9qQg6juFN040HqIARHuItnJ7Ws/1/da"><img src="http://feedads.g.doubleclick.net/~a/Z9qQg6juFN040HqIARHuItnJ7Ws/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">

<a href="http://feeds.feedburner.com/~ff/osxdaily?a=YHPigLqhuF8:8n2K3ZN2kP0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/osxdaily?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/osxdaily?a=YHPigLqhuF8:8n2K3ZN2kP0:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/osxdaily?i=YHPigLqhuF8:8n2K3ZN2kP0:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/osxdaily?a=YHPigLqhuF8:8n2K3ZN2kP0:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/osxdaily?i=YHPigLqhuF8:8n2K3ZN2kP0:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/osxdaily?a=YHPigLqhuF8:8n2K3ZN2kP0:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/osxdaily?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/osxdaily?a=YHPigLqhuF8:8n2K3ZN2kP0:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/osxdaily?d=qj6IDK7rITs" border="0"></img></a>

</div><img src="http://feeds.feedburner.com/~r/osxdaily/~4/YHPigLqhuF8" height="1" width="1"/>

 

View the full article

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic


×
×
  • Create New...