Terminal Activity: Difference between revisions

From OLPC
Jump to navigation Jump to search
(→‎Starting Terminal: separate section for starting a console)
(consistent heading levels, merge the two console sections with a forward ref to it)
Line 24: Line 24:


===Starting a console===
===Starting a console===
You can also access a Linux command prompt by switching to the [[#The Console|console]], instead of starting the Terminal activity.
Another way to bring up the Linux command prompt is by pressing the Ctrl+Alt+Neighborhood keys at the same time. The Neighborhood key is represented by a circle with 8 small dots [[Image:Mesh key f1 small.png]]. This will start a console outside the [[Sugar]] UI and window system.


=== Common '''Terminal''' Commands ===
== Common '''Terminal''' Commands ==


* [[Sugar-Control-Panel|sugar-control-panel]] - Change [[Sugar-Control-Panel#nickname|nickname]], [[Sugar-Control-Panel#Color|XO Color]], [[Sugar-Control-Panel#Time|time zone]] and other options
* [[Sugar-Control-Panel|sugar-control-panel]] - Change [[Sugar-Control-Panel#nickname|nickname]], [[Sugar-Control-Panel#Color|XO Color]], [[Sugar-Control-Panel#Time|time zone]] and other options
Line 37: Line 37:
The core Linux used on the XO is [http://www.Fedora.org Fedora 7].
The core Linux used on the XO is [http://www.Fedora.org Fedora 7].


=== Copy and Paste into Terminal Window ===
== Copy and Paste into Terminal Window ==


It is not possible to [[Terminal#Cutting and Pasting|copy and paste from]] the [[Terminal]] as of Ship.2 (The version all G1G1 donor will receive). So, if you are following some instructions from a web page in the Browse activity, and want to copy them into the Terminal activity, a pen and paper is required unfortunately. Copy/paste, but not Drag-and-Drop, will be possible in Update.1. This has been [http://dev.laptop.org/ticket/5376 logged] on the dev.laptop.org bug tracking system.
It is not possible to [[Terminal#Cutting and Pasting|copy and paste from]] the [[Terminal]] as of Ship.2 (The version all G1G1 donor will receive). So, if you are following some instructions from a web page in the Browse activity, and want to copy them into the Terminal activity, a pen and paper is required unfortunately. Copy/paste, but not Drag-and-Drop, will be possible in Update.1. This has been [http://dev.laptop.org/ticket/5376 logged] on the dev.laptop.org bug tracking system.
Line 43: Line 43:
There is a partial work-around for this problem, using the third button of a mouse. See [[Scroll-Wheel Copy and Paste]]. That page also has instructions to make the right touchpad button act like the third button of a mouse.
There is a partial work-around for this problem, using the third button of a mouse. See [[Scroll-Wheel Copy and Paste]]. That page also has instructions to make the right touchpad button act like the third button of a mouse.


==== Paste script ====
=== Paste script ===


It is also possible to create a script for pasting from the clipboad.
It is also possible to create a script for pasting from the clipboad.
Line 84: Line 84:
* Re-open the terminal activity, the terminal should now be in larger print.
* Re-open the terminal activity, the terminal should now be in larger print.


==The Console==
==Changing font size in the console==
Another way to bring up the Linux command prompt is by pressing the Ctrl+Alt+Neighborhood keys at the same time (the Neighborhood key is represented by a circle with 8 small dots [[Image:Mesh key f1 small.png]]). This will switch to a console that runs outside the [[Sugar]] UI and X Window System.
There is a console that runs outside of the X Window System (Sugar) environment that can be accessed by pressing Ctrl-Alt-[[Image:Mesh key f1 small.png]]. (Note that many Sugar binding are not available in the console, so commands such as sugar-control-panel will not work there.) To increase the font size in the console, type:
(Note that many Sugar binding are not available in the console, so commands such as sugar-control-panel will not work there.)


To return to the X Window System environment, press Ctrl-Alt-[[Image:Home key f3 small.png]].
setfont sun12x22


===Changing font size in the console===
(To return to the X Window System environment, press Ctrl-Alt-[[Image:Home key f3 small.png]].)
To increase the font size in the console, type:

setfont sun12x22


==Cutting and Pasting==
==Cutting and Pasting==

Revision as of 06:14, 26 May 2008

This page is part of the XO Support FAQ.     Support Index | Print This Page
<imagemap>

Image:Support-banner-square.png|173px|community support pages rect 0 0 135 204 [1] rect 135 0 345 204 Support FAQ rect 0 205 135 408 [2]

  1. Comment : there's some whitespace here:

rect 135 205 345 408 Other support

  1. maybe desc none is better. testing.

desc none

</imagemap>

Activity-terminal.svg The Terminal activity grants access to the XO's Linux command line.

The Terminal is a pre-installed Activity that allows you to control your XO directly from a command line, similar to the Terminal program for Mac OSX or the Command Prompt for Microsoft Windows. The Terminal allows you to do far more with your XO than running Sugar activities. But it is also possible to delete your data, and the system data from the command line, so care is needed.

BEWARE: If you become user "root" by executing "su -l " you have full control to destroy all software!


Starting Terminal

The Terminal Activity is found in the Activities taskbar at the bottom of your Home View. You may need to scroll through the Activities taskbar by using the right arrow icon at the bottom of your screen (Frame-scroll-right.gif) to find the Activity-terminal.svg icon.

Note: You can find Keyboard Shortcuts and the keyboard illustrated here.

Starting a console

You can also access a Linux command prompt by switching to the console, instead of starting the Terminal activity.

Common Terminal Commands

The core Linux used on the XO is Fedora 7.

Copy and Paste into Terminal Window

It is not possible to copy and paste from the Terminal as of Ship.2 (The version all G1G1 donor will receive). So, if you are following some instructions from a web page in the Browse activity, and want to copy them into the Terminal activity, a pen and paper is required unfortunately. Copy/paste, but not Drag-and-Drop, will be possible in Update.1. This has been logged on the dev.laptop.org bug tracking system.

There is a partial work-around for this problem, using the third button of a mouse. See Scroll-Wheel Copy and Paste. That page also has instructions to make the right touchpad button act like the third button of a mouse.

Paste script

It is also possible to create a script for pasting from the clipboad.

Open a terminal and create a new file in the home directory, this can be done with nano for example.

   nano paste

In the file enter the following

   #!/usr/bin/python
   import pygtk
   import gtk
   cb = gtk.clipboard_get(selection = "PRIMARY")
   print cb.wait_for_text()

Save then make the file executable by typing

   chmod a+x paste

Finally to run the script to paste from the clipboard type

   ./paste

Change font size in the Terminal Activity

Here is how to increase the print size in the terminal:

  • Launch the Terminal activity.
  • Type
nano ~/.sugar/default/terminalrc
  • Find the line saying
Font = Monospace 8

And change it to

Font = Monospace 16

(or whatever you want).

  • Press Control-X and answer Yes to save.
  • Close the terminal activity (the X in the top right-hand corner)
  • Re-open the terminal activity, the terminal should now be in larger print.

The Console

Another way to bring up the Linux command prompt is by pressing the Ctrl+Alt+Neighborhood keys at the same time (the Neighborhood key is represented by a circle with 8 small dots Mesh key f1 small.png). This will switch to a console that runs outside the Sugar UI and X Window System. (Note that many Sugar binding are not available in the console, so commands such as sugar-control-panel will not work there.)

To return to the X Window System environment, press Ctrl-Alt-Home key f3 small.png.

Changing font size in the console

To increase the font size in the console, type:

setfont sun12x22

Cutting and Pasting

Using build 650

It is not possible to cut and paste from the terminal to other activities. However you can use the the clipboard function (i.e., to cut and paste) to drop text into a terminal if you attach a 3 button USB mouse to your USB port. After you have copied text from the web page(usually Ctl C), switch to the Terminal activity, put your cursor on the command line and click your middle button. Doing that should cause the text to be copied successfully.

Isn't it possible to configure the X Server so that the "double cord" of pressing the left and the right mouse button at the same time, emulate the middle mouse button? But even simpler would be to use the right mouse button for pasting since it is not currently used in the terminal. -- Dov Grobgeld - 2008-01-23


Also try "CTRL+SHIFT+V" for paste.

gnome-terminal

Chew up some of that precious nand and install gnome-terminal so you can paste those long strings into a shell:

su -1
yum install gnome-terminal

Using joyride build 1606

This experimental OS build has cut & paste included and working. You can update your whole system from the terminal as a super user by typing

olpc-update joyride-1606

[Note to authors: suggest providing (perhaps thru a link elsewhere) any well known pitfalls to using this experimental implementation on an XO used by a child]

See Also

  • BASH Reference A longer list of commands that can be used in the Terminal.