Terminal - Chapter 1
App review & tutorial #4
Odoo image and text block

# Terminal

Authors: The Ubuntu App Cats
Contact: info@ubports.com
Category: #Utilities
Where to get it: https://open-store.io/app/com.ubuntu.terminal

What is it?

The Terminal app is a fully-featured GNU / Linux terminal emulator for Ubuntu Touch. 

What happens when you click a button with a mouse or your finger? When you click on a button, a command is executed and interpreted by the shell. You can use a terminal to interact with a shell, but you can also use it to interact with a text-based GUI, sometimes called Terminal User Interface. In Ubuntu Touch, the Terminal GUI applications for viewing or editing text are Gnu Nano, and VIM.

What is GUI?

A GUI application is a Graphical User Interface. It produces a window (or a number of windows), with visual elements like buttons, text input fields, sliders, checkboxes, radio buttons, and so on.

What is a shell?

A shell is a user interface for access to an operating system's services, and it's called a shell because it is the outermost layer around the operating system kernel.  Ubuntu and Ubuntu Touch uses the Bash shell (also known as Bourne Again Shell).

What is the kernel?

The kernel is a computer program at the core of a computer's operating system. It has complete control over everything in the system. On most systems, it is one of the first programs loaded on start-up (after the bootloader). It handles the rest of start-up as well as input/output requests from software, translating them into data-processing instructions for the central processing unit. It handles memory and peripherals like keyboards, monitors, printers, and speakers. [1] 

And what is a Linux command?

A Linux command is an executable program which is stored in directories such as /bin and /usr/bin. A command is composed of three parts: the command itself, options and arguments. Command line is a good place for the curious user who wants to understand how computers work to start. But be very, very careful - especially if you do not have much command line experience. You can easily break your phone! Generally speaking, the Terminal app is not needed for general activity,  or for daily-use users

Once you learn how to log into your Terminal on your device,  have a go at typing the commands below to see the available executable programs on your system:

  • $ ls /bin

  • $ ls /usr/bin


       Odoo - Sample 2 for three columns
       Odoo - Sample 2 for three columns

      Executable commands

      Ubuntu Touch it is not the same OS as Ubuntu on your PC:  by default the system is read-only, although you can switch to read-write mode, but be mindful of these three things if you do it:

      • Switching a device to read-write mode (and/or recovering from it) is an advanced feature and may result in complete data loss.
      • Switching a device to read-write mode disables automatic over-the-air updates (OTA).
      • Switching a device to read-write mode allows you to use executable root commands and break your device.


      Making the system read-write enables developers to access the Ubuntu system directly, but it is not required for normal usage nor even for developing apps. Remember too, that even though you will be able to use cron settings, apt-get, and set up a PPA, only packages built for armhf will be installable (This is not saying though that you cannot use cron and apt-get commands).

      If you are interested in building apps or launching legacy X11-based deb-packages, you can do so safely - without affecting the rootfs and without the need of root acces - by keeping everything sandboxed in a container. One such container is Libertine, developed and maintained by Dan Chapman: www.github.com/ubports/libertine-scope . There is also an Ubuntu Touch Cross Containers page on Github, with a script that will create and configure cross build containers for Ubuntu Touch development: https://github.com/dpniel/ubports-containers/blob/master/README.md This script currently supports creating containers for Ubuntu Touch OS images:

      • Xenial (armhf)

      • Vivid (armhf)


      For the curious and adventurous, those who like to play, visit Kris's coding blog, and try the convergence SSH way: https://kriscode.blogspot.com/2017/12/ssh-and-ubuntu-touch.html. (Thanks Kris.)

      Good sources of high-quality, comprehensive and easily accessible information about Linux and how to use command line can be found at:

      • The Linux Information Project (LINFO): www.linfo.org. (thanks LINFO). And

      • another very user-friendly tutorial can be found here: https://www.unixmen.com/basic-linux-commands-used-linux-journey (thanks Unixmen.)

      • UBports documentation: https://docs.ubports.com/en/latest/


      What can you do in the Terminal

      1. Accessing the app and the Terminal command line

      Tap the Terminal icon. Logging into the Ubuntu Touch Terminal app requires authentication: enter your password (the same one you use to unlock your phone) and press OK.

      (You can make use of UT's screen rotation feature with the Terminal app. You will undoubtedly come to appreciate this, especially when you are using the convergence interface.)

      Odoo text and image block

      2. Introduction

      # Your home directory is: phablet@ubuntu-phablet
      # Your root directory is: root@ubuntu-phablet,
      # To login as superuser, type: $ sudo - i and your password
      # To close the Terminal app, just type the command: $ exit or tap CTRL+D if you're using the control keys layout

      Directory Structure and File System Hierarchy


      Odoo text and image block
      1. Basic file management: pwd, ls, cd, touch, rename, mv, cp, rm, mkdir, rmdir, find, chmod

      2. Insert executable commands and run system and process monitoring tools, see what apps are running and consuming time

      3. Access your registry of logs, gps, webrowser history, sms and calls history, ...

      4. View and edit text files, export notes from a reminder app, export and import your contacts

      5. Run security tools, delete private information, delete cache

      1. Send an sms, make a call, activate tethering / hotspot, chat using the IRC weechat application

      2. Activate and restart wifi, scan your network, launch apps, restart unity8 desktop

      3. Create small shell scripts to automate some services or tasks (you can also use scripts to change or add new layouts or key functions)

      4. Download from internet using the command: $ wget file https://...

      5. Make it possible to read the content of your local HTML files in your browser

      6. See what your hardware specs and also memory distribution are

      7. Change the core apps you have on your apps scope screen

      ...and many, many other things too!

      You can even extend the functionality of the terminal installing some of the Emanuele Sorce's click packages, available in the OpenStore. But use it at your own risk ! (https://open-store.io/?sort=relevance&search=emanuele%20sorce). Thank you Emanuele!

      3. Tips to use the Terminal UI using your finger(s):

      # To COPY or PASTE: hold your finger on the screen until the contextual menu appears 
      # To SCROLL the window UP or DOWN: use two fingers and swipe
      # To CLOSE the activated KEYBOARD interface: hold your finger on the screen
      # To review the COMMAND HISTORY: swipe up using one finger
      # To use the bash PATH AUTO-COMPLETION: click on the incomplete path using one finger
      # Holding the space bar pressed you can use the keyboard as arrow keys
      # Holding and than moving finger (left right) within command line you can edit it as you would use arrow keys

      4. Layouts how-to. One for each occasion:

      • To select a layout, press and hold the square icon on the bottom left side. You'll see the options. Slide the finger to the desired one.

      • Control shortcuts keys (CTRL):

        • CTRL+R (reverse search history), CTRL+C (sends SIGINT), CTRL+A (cursor to the beginning of the line), CTRL+Z (sends SIGTSTP), CTRL+D (EOF, exit)

      • Function shortcuts keys (FNS):

        • ESC, F1 ... F12

      • Gnu Nano: (simple terminal text editor shortcuts keys for, in this order, help, save, read, previous page, cut text, position, exit, indentation, search, next page, paste text, spellcheck:

        • CTRL+G, CTRL+O, CTRL+R, CTRL+Y, CTRL+K, CTRL+C, CTRL+X, CTRL+J, CTRL+W, CTRL+V, CTRL+U, CTRL+T

      • Scroll shorcuts keys (SCR):

        • PG_UP, PG_DN, DEL, HOME, END, TAB, ENTER, navigation arrows

      • Command shortcuts keys (CMD):

        • top, clear, ls, rm, find, chmod

      Odoo text and image block

      5. Icons:

      * Settings (gearwheel icon):

      • Option to enable or disable each layout

      • Font size: it's set to size 10 by default, but you can enlarge it up to size 50

      • Color scheme: there are 9 scheme options to choose from. Embrace your Terminal

      • Login settings: you can enable or disable login authentication

      Odoo text and image block

      *Tabs icon:

      • You can open new terminal windows. Tap the icon beneath the settings button, and then the plus sign (+) to add a new tab.

      • Once you have more than one terminal tab, you can switch between them tapping the icon and then tapping the desired tab.

      • Each tab will be shown as a thumbnail.

      * Keyboard icon:

      • The keyboard interface is summoned by tapping the keyboard icon at the bottom right side of the screen.

      Odoo text and image block

              Application details

              First published: 2017/05/03

              Last update: Version: 0.8, published 2017/08/25

              What's new in the latest version:

              • Fixed bug that allowed to skip the authentication dialogue by pressing escape

              • Requiring login is now optional

              • Updated translations

              Web address / Source Code: [Terminal] (https://github.com/ubports/terminal-app)

              Licence: GNU GPL v3

              Permissions: Copyright © 2017

              Original language: English

              Translated to: -

              [1] From Wikipedia, the free encyclopedia and "Kernel". Linfo. Bellevue Linux Users Group. Retrieved 15 September 2016.


              What do you think of this app?

              Please send your comments and suggestions through the box at the bottom of this blog.


              Explore the full spectrum of Ubuntu Touch Apps at OpenStore - The official Ubuntu Touch app store.

                                Ubuntu Touch at MERGE it 2018
                                Event appearance