Search

Top Posts

Comments

  • David: unfortunately this photo has either been doctored or is a complete fake. hopefully its the former 6 monitors...
  • slatapolsky: I should have updated this earlier, but I went ahead and upgraded from our old Netgear router (G) to a...
  • Cory: @Dave: It looks like 3rd party developers have access to this functionality, but not all use it. For example, I...
  • ZAYIFLAMA YOLLARI: Zayıflama Yolları, diyet listesi,rejim
  • Dan: You’d definitely need a microphone, mic stand and usb audio interface for a start!

Categories

Recent Posts


Command Line Keyboard Shortcuts for Mac OS X

The command line in Mac OS X can be a very powerful and fun tool, so it’s good to know how to maneuver around if you find yourself in it. By default, the Mac OS X Terminal uses the Bash shell, which is what these keyboard shortcuts are intended for. So if you’re ready to get your feet wet, open up the Terminal and try these shortcuts out, they’re sure to make your command line life easier. The list isn’t too crazy so you should be able to try all these out within a minute or two, have fun:

Ctrl + A Go to the beginning of the line you are currently typing on
Ctrl + E Go to the end of the line you are currently typing on
Ctrl + L Clears the Screen, similar to the clear command
Ctrl + U Clears the line before the cursor position. If you are at the end of the line, clears the entire line.
Ctrl + H Same as backspace
Ctrl + R Let’s you search through previously used commands
Ctrl + C Kill whatever you are running
Ctrl + D Exit the current shell
Ctrl + Z Puts whatever you are running into a suspended background process. fg restores it.
Ctrl + W Delete the word before the cursor
Ctrl + K Clear the line after the cursor
Ctrl + T Swap the last two characters before the cursor
Esc + T Swap the last two words before the cursor

Posted by: Editor

Share

Save big on Mac Deals from Amazon.com

Comments:

Comments: 13

Comment from anonymous
Time: December 19, 2006, 3:15 pm

Are you kidding me – I’ve been using Bash for 5 freaking years and I never knew any of this. Thanks!

Comment from soho
Time: December 20, 2006, 1:56 pm

Very nice – thanks alot for this list

Comment from FJ
Time: December 25, 2006, 10:50 am

Love the list, watch out for spammers!

Comment from mrumrici
Time: December 29, 2006, 8:19 pm

Aaweosmeom!!!

Comment from clcl
Time: August 26, 2007, 9:33 am

Cool — I love the Ctrl + L thing as a substitute for clear — because now I can clear the screen, arrow-up for history of my last commands — without having to skip the clear command itself. Sounds trivial, but that was annoying me! Thanks!

Comment from anon
Time: October 8, 2007, 1:56 pm

For those who find this site, you can set the behavior of bash by using:

set -o vi

for vi command editing mode. It defaults in emacs mode (the keybindings above).

vi mode starts in editing mode, but pressing esc and you’re back into the glorious world of vi.

if you want to retain ctrl+L clear screen behavior in vi mode, try adding this to your .bashrc (or equivalent) file:

bind -m vi-insert “\C-l”:clear-screen

(thanks to http://www.jukie.net/~bart/blog/20040326082602)

Comment from Igor Minar
Time: November 1, 2007, 10:46 am

Thanks!

Comment from Tim Harper
Time: December 5, 2007, 8:08 am

Is there any way to change the binding to the delete previous word? I find ctrl-w a difficult reach, and I prefer the apple-backspace.

Thanks!

Pingback from [Mac] Teclas rápidas (shortcuts) para el terminal – SmallSquid.com
Time: February 12, 2009, 4:19 am

[...] Visto en OSXDaily [...]

Comment from Ajay Goel
Time: July 10, 2009, 1:55 pm

Is there any key to delete the word after the cursor, like CTRL + W before the cursor?

Comment from Ajay Goel
Time: July 10, 2009, 1:55 pm

Is there any key to delete the word after the cursor, like CTRL + W before the cursor?

Pingback from Command Line Keyboard Shortcuts for Mac OS X – OS X Daily « Netcrema – creme de la social news via digg + delicious + stumpleupon + reddit
Time: August 20, 2009, 2:16 am

[...] Command Line Keyboard Shortcuts for Mac OS X – OS X Dailyosxdaily.com [...]

Pingback from 21 fresh links for you! « Adrian Zyzik’s Weblog
Time: August 20, 2009, 3:43 am

[...] The Conversation – Now That I Have Your Attention Top 10 YouTube Videos for Social Good  Command Line Keyboard Shortcuts for Mac OS X – OS X Daily Best Science Visualization Videos of 2009 Wired Science Wired.c Screenr: Simple Screencasting for [...]

Write a comment






December 19th, 2006