If it is not explicitly told in following recipe, setting up services are described for Ubuntu 16.04 server, but applications are described for Ubuntu 16.04 and/or Lubuntu 16.04 workstation. If you use different Ubuntu version or Linux distribution, settings as well as content, names and places of configuration files may be different!
Got it.

Command line terminal

Command terminal is useful program for advanced system configuration and diagnostics. Great benefit of textual commands is that they are much easier to document and execute (manually or automatically).

Content

How to start terminal

A: In Ubuntu click on (home) button, enter term and select Terminal icon
B: In Lubuntu select start menu and choose System Tools — LXTerminal
C: Press Alt+F2 key combination and in opened dialog window enter:

  1. gnome-terminal (for Ubuntu)
    or
    lxterminal (for Lubuntu)
  2. Press Enter

D: Press Ctrl+Alt+t key combination (may not work in any environment and settings)

Copying and pasting commands

In terminal window copying pasting is done with following key combinations:

  • Ctrl+Insert to copy,
  • Shift+Insert to paste
  • or right-click mouse button and select Copy or Paste in context menu

How to execute commands from recipes

  1. If no specific comments are added, commands written in separate lines should be executed one-by-one. For example:

    cd ~
    ls

    should be executed in following way:

    1. type cd ~ and press Enter
    2. type ls and press Enter
  2. If lines (commands) are finished with semicolon ; (that notes end of command), then commands can be entered by copying and pasting and executing all lines together. For example:

    cd ~;
    ls

    can be entered and executed by pressing Enter at the end all at once.

  3. If lines with commands end with backslash \ (that notifies to ignore line breaks), then commmands have to be copied and pasted all together. In important places that is usually mentioned in comments, for example: "copy, paste and execute all commands together!", but in general you should look at backslashes in the end of command lines:

    ls \
    -la

    have to be entered and executed all at once.

Stop execution

Some commands like top, tail -f run execution until interrupted. To stop these commands, press Ctrl+c keys.

Stop data stream

If command reads data stream from input, signalize end of data stream pressing Ctrl+d keys.

Looking for and executing commands from history

  1. Previous command can be called by up arrow key in terminal, and executed by pressing Enter.
  2. Previous commands can be viewed by entering command history. For example it could show:

    20206  echo "My secret"|sha256sum|xxd -r -p|base64|cut -b -4|tr "+/=" "abc"
    20207  history
  3. For documentation purposes useful command is history|cut -b 8-, whic cuts off first 8 characters with number of commapds. For example, it could show:

    echo "My secret"|sha256sum|xxd -r -p|base64|cut -b -4|tr "+/=" "abc"
    history
    history|cut -b 8-
  4. Commands can be searched in history by pressing Ctrl+r and then entering start of the command. When necessary command is show in terminal, press Enter.

 

Created by Valdis Vītoliņš on 2010-07-06 13:01
Last modified by Valdis Vītoliņš on 2018-05-09 17:40
Translated into en by Valdis Vītoliņš on 2017-03-03 21:12
 
Xwiki Powered
Creative Commons Attribution 3.0 Unported License