Console

Shortcuts

This shortcuts applicable to bash, zsh, emacs and python console.

Shortcut

Description

Tab

Auto-complete files and folder names

Ctrl+R

Search through used commands

Ctrl+P

Show previous line

Ctrl+N

Show next line

Alt+B

Move cursor backward one word on the current line

Alt+F

Move cursor forward one word on the current line

Ctrl+B

Move cursor backward one character

Ctrl+F

Move cursor backward one character

Ctrl+A

Move cursor to the beginning

Ctrl+E

Move cursor to the end

Ctrl+W

Delete the word before the cursor

Ctrl+H

Delete one character before the cursor. Same as backspace

Ctrl+L

Clears the screen, similar with clear command

Ctrl+U

Clears the line before the cursor position

Ctrl+K

Clear the line after the cursor

Ctrl+T

Swap the last two characters before the cursor

Alt+T

Swap the last two words before the cursor

Ctrl+C

Kill whatever you are running

Ctrl+D

Exit the current shell

Ctrl+Z

Puts into a suspended background process.

Manipulate Process After Ctrl+Z

This is useful so you don’t have to open two or more console.

... run job ...
$ python -m http.server
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
(Ctrl+Z)

... see all jobs ...
$ jobs
[1]+ Stopped              python -m http.server

... revive stopped jobs in the background ...
$ bg 1
... or ...
$ bg %1

... revive stopped jobs ...
$ fg 1
... or ...
$ fg %1

Though the more easy way is just send the job to the background from the beginning by append & at the end.

$ python -m http.server &

Better cmd

After some times I got tired of the ugly cmd. But PowerShell is not quite fit my taste too. Especially after some times with Bash. After trying several alternatives, I found cmder is the best.

Here’s some great features:

  • Better auto completion (including back slash for folder).

  • Bash shortcut in cmd.

  • Context menu in Windows Explorer.

  • Color.

  • Git (with branch name in red color if dirty).

She can even use other font to substitute missing glyph of the main font. I’m obsessed with Monaco. Sadly she didn’t have lambda character. So let’s substitute them.

  1. Select Setting ‣ Main.

  2. Change Unicode ranges to Pseudographics: 0370-03FF; 2013-25C4;

  3. Click Apply.

Context Menu in Windows Explorer

Don’t do this from the setting in Cmder, do this the ancient way.

> cmder.exe /register all