It is accessed by opening a terminal window from GNOME or KDE—the Bash shell command line presented by default.

Several Line Command

Enter command in several lines by typing backslash (\) before pressing the ENTER key. It allows entering the same command to the next line

$ vi /home/ananova/linux-hosting\

Multiple Command in Single Line

A user can enter several commands on the same line, separating them with a semicolon (;). Commands execute in a sequence as begun.
$ ls; date; clear

Conditional Execution of Commands

Use the && operator, to allow command execution only if the previous command runs successfully.

Tab completion Of Command and Filename

BASH command line built-in feature allows auto-complete of a command or file by simply pressing the tab key. The TAB key activates the function to complete the pattern. The Shell waits and beeps if more than one command or the file has the same prefix. In that case, it displays a list of possible command completions and waits to add enough characters to select a single command or filename.
Automatic completion also comes with the names of variables, users, and hosts. Variable names begin with $ sign are selected from previously designed variables, usernames start with a tilde (~), the hostname with @ sign with possible names taken from the /etc/hosts.

Bash built-in bind can set things up and also show an already setup list

bind -p
  • TAB: Automatic completion
  • TAB TAB or ESC: List possible completions
  • ALT /, ^R /: Filename completion
  • ALT $, ^R $: Shell variable completion
  • ALT ~, ^R ~: Username completion
  • ALT @, ^R @: Hostname completion
  • ALT !, ^R!: Command name completion

Command-Line Editing

Provided by Readline, which uses /etc/inputrc file to configure key bindings

Move Keys

  • -> Right Arrow, ^F: Move forward a character
  • <- Left Arrow, ^B: Move backward a character
  • HOME, ^A: Move to the beginning of a line
  • END, ^E: Move to end of the line
  • ALT-F: Move forward a word
  • ALT-B Move backward a word
  • ^L: Clear screen and place line at the top

Edit Keys

  • DEL, ^D: Delete characters next to a cursor
  • BACKSPACE, ^H: Delete cursor before the cursor
  • ^R: Cut remainder of the line from cursor position
  • ^U: Cut from the cursor position to beginning of a line
  • ^W: Cur previous word
  • ^C: cut the entire line
  • Alt-D: Cut the remainder of the word.
  • ALT+DEL: Cut from the cursor to the beginning of a word
  • ^Y: Paste previous cut text
  • ^V: Insert quoted text, used for inserting control or meta keys as text
  • ALT-T: Transpose current and former words
  • ALT-L: Lowercase current word
  • ALT-U: Uppercase-Current word
  • ALT-C: Capitalize on the present word
  • ^SHIFT_: UNDO past change

>> Next Page – The Linux Command Line Interface (CLI) -2