Love the web

Love the web is a design, programming, and usability blog

Terminal shortcuts for Mac 3 comments

David Montgomery 09 Apr 2010

I find I spend a lot of time on the command line using svn. It`s good to know these simple shortcuts that at the end of the day makes life easier. Of course there are more out there, but for me I can`t live without these ones.

The commands

  1. Clear screen - command + k
  2. Delete from end of line - control + u
  3. Return to beginning of line - control + a
  4. End of line - control + e

The gem

Yes, I have to admit it. I have always been jealous of those guys on their PC's while working on the command line. With a quick double click to a path anywhere, a click of the middle mouse button and bam, it gets pasted at your current focus. On a Mac you can`t do this so easily. But there is a way...

  1. Shift + command + double click - (to select the path)
  2. Click with middle mouse button - (to paste into current focus)

The challenge

I hope this has been helpful. Do you have any other "gems" that can make workflows more efficient on the command line? let us know. Your comments are always appreciated.

Read the next post - Javascript Drop Shadows

Subscribe to these comments

3 comments submit a comment

09 Apr 2010

Lance

Kind of a shortcut, adding common paths (EG mysql) to your profile on a Mac. The less I have to type the better...

edit the file: /etc/profile and update the path by adding:
usr/local/mysql/bin/
for example:
PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/mysql/bin"

From: http://www.comentum.com/mysql-administration.html

19 Apr 2010

Tim Higgs

Hey Dave. Just thought I'd make mention of a couple of things. Your first shortcut is a Mac OS X terminal shortcut; the rest are shell shortcuts (so tsch or bash etc...). An alternative to the "command k" / "clear screen" command is "ctrl l" - which works for several shells ("command k" kills scroll history too).

Some additional shell shortcuts (that work in a few different shells) that are really useful:

- 'ctrl k' : cut from cursor to end of line (puts into cut / paste buffer)

- 'ctrl y' : paste from buffer (will also paste text cut with 'ctrl u')

- 'ctrl a' / 'ctrl e' : move to start / to end of line

- 'esc' then 'delete' : cut one word (which of course can then be pasted)

- 'esc' then 'l' / 'c' / 'u' : make the following word lowercase / capitalised / uppercase

Handily, a bunch of these shortcuts work in a variety of text editors, such as EMACS

21 Apr 2010

Dave

Hey Thanks Tim, great stuff, really useful!

Submit a comment

Submit comment