English فارسی Suomi
Français Nederlands Translate
EDIT

Discovering Discovery

The Undiscoverable: Terminal

The Terminal activity provides a Linux command line. Linux command names are cryptic and essentially Undiscoverable. The usage of the commands is even more Undiscoverable. On larger computers running Linux or any other form of Unix, there is some cryptic documentation of these commands in "man" pages (short for "manual"). On the XO, however, this documentation has been omitted to save space.

But all is not lost. Detailed information about the command line is available on the Internet. Don't bother about man pages to start with. They are fine for programmers and other experienced users. In fact, most command line documentation is aimed at programmers and system administrators. I recommend instead the FLOSS Manuals (FM) and Free Software Foundation (FSF) Introduction to the GNU/Linux Command Line, which I helped write. It is aimed at new users, and describes the commands that new users most often need.

Here is a quick sampling.

The command

pwd

(Print Working Directory) will tell you the full name of the directory you are in. No, I'm not going to explain Linux file naming.

In your home directory,

cd bin

will take you to the bin (binary, executables) directory, if you have one. From anywhere,

cd

with no directory name will take you to your home directory.

df -h

will tell you how much free space you have in the XO's flash storage. The "-h" part tells Linux to use units that make sense to non-programmers.

ls

lists files in the current directory

ls -al

lists files and gives further information about them.


Now I am going to give you a procedure to follow, with no explanation. You can read the FM/FSF guide and the FM manuals for the XO and Sugar some time if you feel the need. (I hope you do, but not just yet.) This procedure will make Terminal much easier to use, and provide some other functions that Sugar 0.84 omits, particularly the ability to change keyboard layouts.

  1. Make sure that your XO is connected to the Internet, and is well charged.
  2. Find and open Terminal. You will see a command prompt, something like

    [olpc@xo-14-68-2d ~]$

    Don't worry about it.
  1. Enter the command
  2. sudo yum install mc
  3. and press Enter. (You will do this after every command. I won't mention it again.)
  4. This will install the Midnight Commander, which provides many fairly discoverable menu options in place of text commands.
  5. Follow instructions, and say Yes at the appropriate time.
  6. Enter the command
  7. mc
  8. You see two panels showing views of the Linux file system, which we normally keep hidden from schoolchildren. You also see menus and numbered commands. You can explore and discover later.
  9. On the Settings menu, choose Configuration.
  10. Select "Lynx-like motion".
  11. Click 5 Create dir
  12. Enter "bin"
  13. Put the cursor on the bin directory, and use the right arrow key to enter it.
  14. Enter
  15. touch asdf
  16. to create an empty file named asdf.
  17. Select asdf, and click F4 to edit it.
  18. Enter this text.
  19. #!/bin/bash
  20. setxkbmap dvorak
  21. Click F2 to save, then F10 to exit the editor.
  22. On the File menu, click chmod, and check the execute lines. Then click OK.
  23. Similarly, create a file named "aoeu", and enter
  24. #!/bin/bash
  • setxkbmap us
  • Save it and exit the editor, and make it executable as above.
  • Now  you can use the command asdf to switch to a Dvorak keyboard, and aoeu to switch back. You may not care that the Dvorak keyboard is more efficient than the standard QWERTY layout, but I use Dvorak all the time, and thought you should at least know it exists. But I won't teach it to you. You can find out more about it in Wikipedia.
  • Next we will create two files, ru and , to switch to Russian Cyrillic and back. Be careful with the order of steps here, so that you do not get stuck in Cyrillic before you have the command with a Cyrillic name to get out.
  • First, make a file, ru, with the following contents

    1. #!/bin/bash

    setxkbmap ru

    Now make a copy of aoeu, with any name you like. (How?)

    If you execute the ru command, you will switch to the standard Cyrillic keyboard. Select the copy of aoeu, and use the F6 RenMov command to rename it in Cyrillic. If you use the same four keys as for asdf and aoeu, you will get the name .

    Now you can get back safely to the US layout.

    F10 takes you out of mc and back to the plain command line.


    EDIT