CLI Spells for the Raspberry Pi

This Page is a Quickstart for CLI on the Raspberry PI.--Brian 09:13, 20 April 2012 (UTC)

Why Do I Need the CLI?

(CLI-Command Line Interpreter)

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 but 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.

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 sytax for a comman then do an Internet search for the command or find a Bash Quick Reference Card.

If you want to know how to use commands without using the Internet then use

$ man

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".

Commands take the form

 | - |  | 

<> are often used in Syntax guides to indicate that the <> surround a description of a command rather than a coomand and | 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 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).

e.g. "ls -l /home/brian" means List in Long Format (the -l switch) the directory (target) /home/brian

mount -F smbfs //workgroup;fred:foo@192.168.1.99/homes /mnt/net

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)

'''Task cd. Navigating the file system using "cd"''' 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

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

'''Task ls. Listing the files and Folders in a particular place'''