The Robotics Primer Workbook
Developed by  USC, iRobot® and Microsoft® Robotics Studio

Linux 101

Contents

Case Sensitive

Linux is a case-sensitive operating system. All files (including directories) and commands require correct capitalization.

The filesystem Structure

The linux filesystem is structured like a tree. The base of the tree is called the root, and is designated by a /. All subsequent directories are branches from the root. Listed below of some of the more important branches:

Absolute and Relative Path Names

A path name is a text string containing symbols and characters that represent a specific file or directory. Absolute path names start from the filesystem root and progress to the file or directory. Each directory is separated by a forward slash, /. The following are absolute paths:

Relative paths specify a directory or file starting from the current working directory. Assuming that the current working directory is /home, the following path names are equivalent to the those previously listed:

The .. symbol refers to the previous directory, which in the example above is the root of the filesystem.

Users and Superuser

Every person who uses a linux computer should have a separate username and password. A standard user has restricted access to parts of the linux filesystem, preventing them from deleting essential files and executing inappropriate commands. There exists one super-user, or root, account from which all functionality is accessible. As a rule of thumb, the super-user account should only be used when absolutely necessary. This prevent accidents from happening.

Each regular user also has a home directory where they can store personal files. The home directory is named after the username of the account. For instance, a person with the username of joesmith will have a home directory of /home/joesmith. The tilde symbol, ~, refers to the current user's home directory, which makes /home/joesmith and ~ equivalent assuming that joesmith is the current user.

The terminal

The basic mode of interacting with linux is via a shell or terminal. The terminal accepts user input through commands, and produces useful output via standard out. The terminal consists of prompt, which typically consists of the current directory path followed by a dollar sign, for example ~ $. When logged in as super-user the prompt changes to a hash #.

Getting around the filesystem

Once a terminal is open, one of the fundamental operations is changing directories and view files. Listed below are a few essential commands:

Example that lists the contents of a fictional home directory

~$ ls
public_html/
work/
bin/
~$

Example that changes directory from the user's home to public_html

~$ cd public_html
~/public_html $

Example that changes the directory back to home in two different manners

~/public_html $ cd ~
~ $
The cd command without any arguments will also return to the user's home directory
~/public_html $ cd
~$
~ $ less my_text_file

Example will display the manual page for the ls command.

~ $> man ls

Example to create a directory called "my_dir"

~ $ mkdir my_dir

The first example removes a file called "my_file", and the second example removes a directory called "my_dir"

~ $ rm my_file
~ $ rm -rf my_dir

Retrieved from "http://roboticsprimer.sourceforge.net/workbook/Linux_101"

This page has been accessed 1,305 times. This page was last modified 00:56, 23 September 2007. Content is available under GNU Free Documentation License 1.2.


Browse
Main Page
Glossary
Sections
Prerequisites
Introduction
Robot Components
Locomotion
Sensors
Feedback Control
Deliberative Control
Reactive Control
Hybrid Control
Behavior-based Control
Emergent Behavior
Navigation
Group Robotics
Learning


Log in / create account