Terminal Activity: Difference between revisions
(5 intermediate revisions by the same user not shown) | |||
Line 41: | Line 41: | ||
== Copy and paste in Terminal == |
== Copy and paste in Terminal == |
||
* Use the Edit menu |
|||
Several options: |
|||
Where is the Edit menu? |
|||
* Use the Edit menu, which is underneath the scissors icon, |
|||
* Press Shift+Ctrl+C to copy, Shift+Ctrl+V to paste, |
|||
⚫ | |||
⚫ | |||
* Configure a bluetooth mouse on an XO-4 and use the middle mouse button to paste, |
|||
⚫ | |||
* Press Shift+Ctrl+C to copy, Shift+Ctrl+V to paste. (You have to hold the shift key down in addition because Ctrl+C and Ctrl+V are meaningful key combinations in terminal programs.) |
|||
⚫ | |||
⚫ | |||
== Copy from Wiki and Paste in Terminal == |
|||
⚫ | |||
Many Wiki pages provide commands that are to be pasted into Terminal. For example: |
|||
echo this is a test |
|||
echo hello world |
|||
What you should do is: |
|||
* Start the Terminal activity, |
|||
* Press Alt-Tab to switch to the Browse activity, |
|||
* Use the mouse or touchpad to highlight the text of the commands, |
|||
* Press Ctrl+C to copy, |
|||
* Press Alt-Tab to switch to the Terminal activity, |
|||
* Press Shift+Ctrl+V to paste, |
|||
* Look at the outcome of the commands. |
|||
See also [[Compound_commands#Copy_and_paste|how to copy and paste a compound command]]. |
|||
== Other keystroke commands == |
== Other keystroke commands == |
||
Line 71: | Line 87: | ||
===Logging in=== |
===Logging in=== |
||
Press enter, and the console will log you in as ''root''. |
Press enter, and the console will log you in as ''root''. |
||
You are now logged in as the [[root]] user, be very careful. |
You are now logged in as the [[root]] user, be very careful. |
||
== Alternative terminal program== |
== Alternative terminal program== |
||
You can install gnome-terminal: |
|||
[[su -l]] |
|||
[[yum]] install gnome-terminal |
|||
Here are the changes proposed: |
|||
After you press return you may receive a number of lines of text which end with "error 404 Not Found |
|||
Trying other mirror". |
|||
Be Patient: Eventually you should see a download of 4.4 MB then on the next line |
|||
fedora |
|||
then you will see |
|||
primary.squlite.bz 2 6.1MB |
|||
When you receive a -bash-3.2# prompt the load is complete. |
|||
End of change so far: |
|||
Use an existing terminal session to launch a 'gnome-terminal' session. |
|||
COMMENT: |
|||
Here there should be additional guidance. What is done next is not clear. The natural thing to do would be to exit the root into for the normal terminal prompt |
|||
Then enter "gnome" or "gnome-terminal" . |
|||
However neither command yields anything but |
|||
"bash: gnome-terminal (or gnome): command not found. |
|||
You may also switch to the GNOME desktop to use the Terminal program there, in the Applications -> System tools menu. |
|||
So that is all i can contribute at this time. LUDD. |
|||
== See also == |
== See also == |
||
* [[Linux software]] A brief description of <i>some</i> of the linux software that is installed with Sugar. |
* [[Linux software]] A brief description of <i>some</i> of the linux software that is installed with Sugar. |
||
* [http://www.ss64.com/bash/ BASH Reference] A longer list of commands and programs (many are not installed on the XO |
* [http://www.ss64.com/bash/ BASH Reference] A longer list of commands and programs (many are not installed on the XO by default because they aren't needed). |
Latest revision as of 03:09, 5 December 2013
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]
- Comment : there's some whitespace here:
rect 135 205 345 408 Other support
- maybe desc none is better. testing.
desc none
</imagemap>The Terminal activity grants access to the XO's Linux command line.
The Terminal is an Activity that allows you to control your XO directly from a command line, similar to the Terminal program in Mac OS X or the Command Prompt in Microsoft Windows. The Terminal allows you to do far more with your XO than running Sugar activities. But BEWARE it is also possible to delete your data, so be careful. And if you become the root user, you have full control of the computer and can destroy all software!
See the Terminal manual.
Starting Terminal
The Terminal Activity is usually not marked as a favorite, so it does not appear in the Home View Favorites view.
In the Home View, press ctrl-2 to select the List view, search for Terminal, and click on it to start.
You might also mark it as a favorite if you like.
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
When you start Terminal, it runs the Bash "shell" program that interprets keystrokes and commands. Its main job is to allow you to run other programs, for example:
- nano for editing text files directly. If you want to edit text files in Sugar, use Write.
- yum for automatically installing new software.
- rpm - another way to automatically install new software
- olpc-logbat - log the activity of the battery system. Useful for assisting developers in debugging battery problems.
There are hundreds of Linux commands available in the Terminal, Linux software describes some more of them. The OLPC system software on the XO is a slimmed-down version of Fedora and so its command-line programs come from Fedora. Many command-line programs from Fedora are not available but experienced users can add them using yum or rpm.
Users and super-user
Initially Terminal begins as the default user (usually "olpc"). Some programs require that you run them as the root "super-user. You can prepend sudo to some of these, or press the #_ icon in the Activity menu to become root, or enter su -l to become root. The root user has awesome destructive power, do not run commands as root unless you have to.
Copy and paste in Terminal
Several options:
- Use the Edit menu, which is underneath the scissors icon,
- Press Shift+Ctrl+C to copy, Shift+Ctrl+V to paste,
- Plug a three-button USB mouse into a port and use the middle mouse button to paste,
- Click both buttons below the track pad (or click directly between them) to paste.
- Configure a bluetooth mouse on an XO-4 and use the middle mouse button to paste,
You can select text in Terminal's window and use the mouse or track pad methods to duplicate it without first copying it to the clipboard.
Copy from Wiki and Paste in Terminal
Many Wiki pages provide commands that are to be pasted into Terminal. For example:
echo this is a test echo hello world
What you should do is:
- Start the Terminal activity,
- Press Alt-Tab to switch to the Browse activity,
- Use the mouse or touchpad to highlight the text of the commands,
- Press Ctrl+C to copy,
- Press Alt-Tab to switch to the Terminal activity,
- Press Shift+Ctrl+V to paste,
- Look at the outcome of the commands.
See also how to copy and paste a compound command.
Other keystroke commands
Keyboard shortcuts lists special keys in Sugar. Some of these don't work in Terminal, or require that you press the Shift key as well.
Change font size in the Terminal activity
To change the font size, click on the eye icon, then click on - or +.
The Console
Another way to bring up the Linux command prompt is by pressing the Ctrl+Alt+F2 keys in sequence.
By design, not all XOs have the F2 legend on the key, see Keyboard#Missing_keys.
Ctrl-Alt-F2 will switch to a console terminal that runs outside the Sugar and GNOME.
To return to the Sugar or GNOME environment, press Alt+F1. (On releases before 11.2.0, use Alt+F3).
Most Sugar or GNOME commands won't work on the console.
Logging in
Press enter, and the console will log you in as root. You are now logged in as the root user, be very careful.
Alternative terminal program
You may also switch to the GNOME desktop to use the Terminal program there, in the Applications -> System tools menu.
See also
- Linux software A brief description of some of the linux software that is installed with Sugar.
- BASH Reference A longer list of commands and programs (many are not installed on the XO by default because they aren't needed).