Means use the username fred and password foo (parameters) to make the shared drive called homes on the Windows server at 192.168.1.99 (parameter) appear in the directory tree at the point /mnt/net (target) using the Server Message Block Filing System (the -F switch)

Means use the username fred and password foo (parameters) to make the shared drive called homes on the Windows server at 192.168.1.99 (parameter) appear in the directory tree at the point /mnt/net (target) using the Server Message Block Filing System (the -F switch)

The file system in Linux is Hierarchical with nested directories. (Often called Folders) in a "Tree".

The file system in Linux is Hierarchical with nested directories. (Often called Folders) in a "Tree".

The top of the directory structure is "/" and Directories underneath / are referred to using "Paths" just like urls in a web browser. To go to a particular place in the directory structure you use ''cd''.

The top of the directory structure is "/" and Directories underneath / are referred to using "Paths" just like urls in a web browser. To go to a particular place in the directory structure you use ''cd''.

Line 62:

Line 62:

To go one Directory "Up" the tree then do "cd .."

To go one Directory "Up" the tree then do "cd .."

+

== Task [http://en.wikipedia.org/wiki/Ls $ ls]. Listing the files and Folders in a particular place ==

== Task [http://en.wikipedia.org/wiki/Ls $ ls]. Listing the files and Folders in a particular place ==

Why Do I Need the CLI?

Raspberry Pi ships with a version of Linux. The CLI is run from the GUI by running a treminal or if there is no GUI running and the RPi is working, then the CLI is running on your screen.

The Raspberry PI ships with a GUI. Running the XServer & Windows Manager (The two bits of software that give you a GUI) takes up a lot of Processor Power and Memory. A Raspberry Pi doing some task or other may well have no screen at all and you may manage it remotely using a remote log in to a terminal. You do not want to be running a GUI unless you need it.

Windows and Mac users are generally guided away from the CLI hence this Quick start Guide.

The quick answer to "why do I need the CLI?" then, is that the CLI is going to be a very useful tool for Raspberry Pi users.

Commands are just programs

When you type a into the terminal you are running programs. Most of the commands listed here run programs that give you the ability to command the system to do something. When you add programs to your pi, you will be able to run more commands. This means that if a command you run and expect to work returns the message
$ bash: foo: command not found...

It just means that you have not installed "foo" yet.

To use the CLI you need to know commands and the default command set is contained in the "shell" you are using. There are Lots of shells out there and the one on this Raspberry Pi is Bash Wikipedia Bash Entry.

To find the syntax for a command do an Internet search for the command or find a Bash Quick Reference Card. In this wiki entry, each command has a link to the Wikipedia entry for that command.

If you want to know how to use commands without using the Internet then use man (short for manual).

$ man <command>
or
$ info <command>

from the CLI to be sent to a page of guidance.

The guidance given by "man" is sometimes a bit formal to the point that it could be said, "if you think you know a command then go to the command's man page in order to find out that you don't really".

General Syntax of Commands

Commands take the form

<Command> | -<Switches> | <Parameters> | <Target>

<> are often used in Syntax guides to indicate that the <> surround a place for a command rather than a command. | is used to denote OR or Optional so in the line above we read that a Command can be used on its own but may be followed by
Switches (single letters, preceded by a hyphen that adjust what the command does),
Parameters (Things that the command needs to know in order to work) and a
Target (The thing that the command will be applied to).

Means use the username fred and password foo (parameters) to make the shared drive called homes on the Windows server at 192.168.1.99 (parameter) appear in the directory tree at the point /mnt/net (target) using the Server Message Block Filing System (the -F switch)

The file system in Linux is Hierarchical with nested directories. (Often called Folders) in a "Tree".
The top of the directory structure is "/" and Directories underneath / are referred to using "Paths" just like urls in a web browser. To go to a particular place in the directory structure you use cd.
e.g.cd / will take you to the top of the Directory Tree

To go to a particular place use cd followed by the location in the tree.

cd /home/brian/Documents will take you to "Brian's" home directory Documents Folder. File & Directory Names are Case Sensitive in Linux

$ ls list all the file in the current directory.
$ ls -l list all the file in the current directory and display the long version of the information about each file or directory.
The output may be colour coded depending on the terminal preferences that you have set.
ls -l tells you (amonst other stuff) the size, owner and security setting on each file.
Other useful invocations are
ls -R Recursive. i.e. list contents of sub-directories as well as this directory.
ls -A Show "Hidden" Files. ie. Hidden files are file names that start with a dot which in Unix GUI file navigators are (by default) hidden.

This command introduces the SuperUser or root user. Many commands are only permissible to the root user and by invoking sudo before a command, you are saying "do the following command as the root user". When you do this, you will be asked for your password and if you have system permissions (commonly called beinmg in the admin group) to be a root user then the command will be run. If you do not then a message will tell you so.

There is another way of doing things as root user and that is by using

which stands for "substitute user" (or SuperUser) & as invoked here means "become the root user". From this point on, all command run as the super user. Invoking this command will cause you to be asked for the root password. Some systems do not allow this to happoen in a default install in which case you have to enable the root user.
When you enter passwords in Unix like systems, you will not see asterisks or anything at the prompt but the password is being entered nevertheless.
If you habitually do everything as the root user, eventually you will do something both educational and disasterous. For example, you could invoke

"rm -r -f /* " and delete all the files in the whole system.

$ rm -r -f ./* would just delete the files in the current directory. You do not usually get warnings as root user. (Other than this one).

Mount is the way in which you connect a Unix system to external devices. There is no "C" drive as in Windows. What happens in Linux (& FreeBSD/OSx) is that a device is mounted in the filing system somewhere and when you navigate to that place. The items offered by the device will appear at that point.

This is a complex command. The switches, parameters and target of the Mount command will vary according to the protocol of the system being mounted. Some things will automount. This is why, when you plug a SDcard into a modern Linux, the filing system will automatically pick it up.

Manual Mounting requires a "Mount Point". That means a directory which will be filled with the mounted device when it is mounted. Often, this is in the directory /mnt/ somewhere.

Generally, first ensure there is a mount point, if not then create a directory at the point needed.
e.g. $ mkdir /mnt/netfolder

The issue Mount with the necessary switches, parameters and directories.