Quick Start

Don’t

  • Make the user root (system administrator’s account) accessible via ssh.
  • Run applications as root, applications might contain a vulnerability if the application is compromised it can run malicious code as root.
  • copy/paste rm select * from ... in your console, careful with what you have in your system clipboard.

Avoid

  • configuring server logins with user and password.
  • using root user as a system admin, you can make mistakes.
  • using globbing *, * matches any string, including the empty string. eg: rm *

Shells

The shell is a program that takes commands from the keyboard and gives them to the operating system to perform. Shells are usually run via a terminal emulator, this is a program that opens a window and lets you interact with a shell.

Popular shells: bash, zsh, ksh, dash, sh

Using Bash features

Key or key combinationFunction
Ctrl+AMove the cursor to the beginning of the command line
Ctrl+CEnd a running program and return the prompt
Ctrl+DLog out of the current shell session, equal to typing exit or logout
Ctrl+EMove the cursor to the end of the command line
Ctrl+HGenerate backspace character
Ctrl+LClear this terminal
Ctrl+RSearch command history
Ctrl+ZSuspend a program
ArrowLeft and ArrowRightMove the cursor one place to the left or right on the command line
ArrowUp and ArrowDownBrowse history. Go to the line that you want to repeat, edit details if necessary, and press Enter to save time.
TabCommand or filename completion
Tab TabShows file or command completion possibilities

Getting help

# man [command]
man ls           # see manual for ls command
# command --help (long)
ps --help        # print program help