Terminal Activity

Entering Commands

Using the Terminal Activity is quite simple - you just need to type commands and press the enter key. The trick is knowing what to type and the basic structure of a command.

Let's look at entering a simple command into the terminal and then we will look at the structure of commands. Open the Terminal Activity and simply type the "ls" command and press enter:

ls_1 

You see something similar to the image above. "ls" is the command that lists files and directories. So the output of "ls" is a list of all the files and folders in the directory you are currently in.

Parameters

Next we move on to controlling commands a little bit more by asking them to do more specific actions. We do this by sending more specific requests to the commands - these are known as parameters and they are simply extra information that refine the command's actions.

The "ls" command has several of these parameters you can use. The "a" parameter, for example, means list all files and folders. To use this parameter we would type this:

ls -a

In the terminal you would then see something like this:

lsa

There are probably a few things you are wondering. Firstly - wasn't the "ls" command by itself meant to show all files and folders? Well, "ls" only lists items that are not hidden. If you use the "a" parameter then you see all the "hidden files" as well. Secondly you might wonder how you know what parameters are available for each command. Unfortunately in some installations of Sugar you do not have access to two very nice commands - "man" and "info". These two commands would help a great deal because they are short manuals on all commands installed. The next best thing is to type the name of your command followed by "--help". With the "ls" command we would type this:

ls --help

and the output would be information about the available parameters. Unfortunately there is often too much information to display and so it scrolls though the terminal window too quickly to read. If this is the case you need to combine the command with a "more" command like this:

ls --help | more

In the above example you would have as much information as can be displayed in the terminal window at one time. Then you press the spacebar and you see the next "page" of information etc.