Lullabot Ideas

We know stuff. We empower you to know stuff too.

Command Line Basics: Handy shortcuts

Video by Addison Berry

Make life a little nicer on the command line

short-cli-basics-12-shortcuts.mov-1.png

Watch the video on Drupalize.me

This video covers some handy tips for reusing previously run commands and moving around through a line of text in the command line interface. These shortcuts make working on the command line much faster and nicer. Trying to remember all of these is not easy to do until you've used them for a while, so we also have a handy-dandy cheat sheet which you can download and refer to whenever you are in command line ninja mode.

AttachmentSize
Command Line Handy Shortcuts Cheat Sheet141.58 KB

Comments

w00t!

Awesome tips Addi! Thanks! I <3 your posts. :)

Thanks!

This whole series has been so helpful. Looking forward to more. Thanks!

Thanks! Very Very Cool

Thanks for wonderful tutorial Addi! Loved it!

Extra bindings

Hi,

Another handle couple of short cuts is Esc-b for back work and Esc-f for forward word.

Another thing if you want to dig around a bit more is to do a "bind -p" which will print out all the bash bindings.

Gordon

shortcut

It's very valuable command line ...

Thanks for sharing this ...

Regards

Handy presentation

Thanks Addi, neat little tips
:D

Handy presentation

Thanks Addi, neat little tips
:D

audio converter

good post, thanks for sharing!

Great tips. I had never known

Great tips.

I had never known things like ctrl+E or ctrl+a but I have always stayed close to my home and end keys, that do the same thing.

another cheat sheet and my favorit new command

My favorite new command is:
history
it shows you all your previous commands in a long list.
To show them page by page:
history | less

I found myself refering back to this video a couple times so I took some notes to make it quicker. These are a bit more compact than the attached pdf and contain the !! trick at the end.

'up/down arrow' or 'control p/n' - navigate previous commands
'control r' - searches previous commands ('control r' again to find next result)
'esc' - copy command from past to edit it
'right/left arrow' or 'control f/b' - move curser right and left
'control e' - move to end of the line
'control a' - move to front of the line
'delete' or 'control h' - delete before cursor
'control d' - delete after cursor
'control w' - delete word before cursor
'control u' - delete everything before cursor
'control k' - delete everything after cursor
!! - run previous command ( you can add test before or after it.)