Feed on

Bash hot-keys 1

Granted, some of these are probably SSH or Putty hot-keys. I’m not certain there’s going to be a “Bash hot-keys 2” post, but there are probably plenty of combinations I’ve forgotten or have yet to learn, so we’ll call this post part 1, and there will most likely be more.

That’s a lowercase L. This has the same effect of running ‘clear’. It erases everything on the screen and then sticks your $PS1 prompt at the top.

Perform a reverse search through your bash history. For example, hit ctrl+r then type “grep”, and it’ll pull up the last command you ran that included the string “grep”.

Essentially pauses the shell, and sticks all keystrokes into a buffer that is sent as soon as you use the un-pause key combo. You can’t delete from the buffer, so if you type a command and hit return, then hold backspace, when you un-pause the shell it will send that command and then send a bunch of backspaces.

Un-pauses the shell, and sends all keystrokes in the buffer.

Everyone knows this one. It sends a SIGTERM. In the shell, that has the effect of aborting the current command and giving you a new $PS1 prompt.

Sends an EOF character. If you’re sitting at an input buffer, it closes that buffer. If you’re sitting at an empty command prompt, it logs out of the session – same as typing ‘exit’ or ‘logout’.

Basically, ctrl+v holds the ‘ctrl’ button. If you want to type the character ‘ctrl+c’, obviously you can’t just hit ctrl+c – that will just send a SIGTERM. Instead you can hit ctrl+v, then press ‘c’. Instead of seeing a ‘c’ in your shell, you’ll see “^C”, which indicates a ‘ctrl+c’ character.

Of all these, the most useful is definitely ctrl+r. Get comfortable with it and you’ll save an hour of keystrokes every month. The others will save you fractions of a second here and there.

Hello world!

The first program in any language should always be a salutation to those who came before.

echo “Hello world!”

printf(“Hello world!”);

system.out.println(“Hello world!”);

cout << “Hello World!” << endl;

print “Hello world\n”;

10 PRINT “Hello world!”

puts “Hello world!”

(display ‘”Hello world!”)

« Newer Posts