Command History and Efficiency Print

  • 0

Working faster.

WHAT HISTORY PROVIDES

A record of commands you have run.

HOW TO SEARCH IT

Control and r, then type part of the command.

WHY THAT IS THE SINGLE MOST USEFUL SHORTCUT

Most commands are repeats or near-repeats.

WHAT AN EXCLAMATION MARK AND A NUMBER DOES

Repeats a command from history.

WHAT TWO EXCLAMATION MARKS DO

Repeat the previous command.

WHERE THAT HELPS

Prefixing with sudo after a permission error.

WHAT TAB COMPLETION DOES

Completes commands, paths and sometimes options.

WHY IT PREVENTS ERRORS

It confirms a path exists as you type it.

WHAT ALIASES PROVIDE

Short names for long commands.

WHAT TO ALIAS CAUTIOUSLY

Destructive commands.

WHY

An alias making deletion interactive is helpful until you work on a machine without it.

WHAT THE USEFUL MOVEMENT KEYS ARE

Start and end of line Delete to start or end Move by word

WHAT TO KEEP OUT OF HISTORY

Commands containing passwords.

HOW

A leading space, where the shell is configured to ignore such lines.

WHAT TO CHECK ON A SHARED SERVER

That history is not exposing credentials.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot