ROS-Industrial Basic Developer’s
Training Class:
Linux Basics
Southwest Research Institute
Last Updated 2017
1
4 June 2013
Outline
• What is Linux?
• Navigating the Ubuntu GUI
• Using the Terminal
4 June 2013
2
An Introduction to Linux
• An operating system (think Windows/MacOS X)
• Used on everything from Android phones to web
servers
• Open source – you can add software to/remove
software from, modify internal workings, etc., to
core components as needed
• Actually a loose collection of software collected
together – There are multiple “distributions” of
Linux
• We will be using Ubuntu for this course
4 June 2013 Managed by: Southwest Research Institute
3
A Lightning Primer to the
Ubuntu GUI
4
4 June 2013
The Ubuntu GUI
4 June 2013
5
Where Is Everything?
• Ubuntu icon at top left is
“Start button”
• Applications show up below,
can be “pinned” to launcher
(some are already)
• 2x2 grid is workspace
launcher; any thumb drives,
CDs, etc. are shown below
icon
• Top right corner is “system
tray”/notification area
• Gear icon at top right can be
used to shut down or log off
computer
4 June 2013 Managed by: Southwest Research Institute
6
Ubuntu Windows
• Close, minimize, and
maximize buttons are
at top left of window,
not top right
• Menu bar is at top of
screen, not window
(like Macs)
• Must hover mouse
over top window to
view
4 June 2013 Managed by: Southwest Research Institute
7
Starting Applications
• Click on the Ubuntu icon
and start typing
• Searches application
filenames, titles,
descriptions, etc., for your
input
• When the application
shows up, click on it to
start
• Also searches files, etc.
for search terms
4 June 2013 Managed by: Southwest Research Institute
8
Launcher Bar
• Little triangles on the
left side of the icon
show that there are
windows of that
application open
• Triangle on the right
side shows which
window has focus
• To pin launcher, right-
click on icon and select
“Add to launcher”
4 June 2013 Managed by: Southwest Research Institute
9
Bringing Windows to
Foreground
• If you have multiple
windows of the same
type open, multiple
triangles show up on left
side
• Single Window: Clicking
on icon will bring window
to foreground
• If you click on an icon
with multiple windows
open, all of the possible
windows are brought to
the foreground
4 June 2013 Managed by: Southwest Research Institute
10
The Linux File System
• Hierarchical file system, similar to Windows/Mac
• Major differences from Windows:
– Linux uses / character for separating directories, not \
– No concept of C: Drive – the primary hard drive is
mounted as the root (/) folder, and all CD-ROMs,
network drives, etc. are mounted as subfolders of the
root, e.g. /media/THUMBDRIVE
– Linux file system can contain more than files (disk
drives, serial ports, etc.)
4 June 2013 Managed by: Southwest Research Institute
11
The Linux File System (cont’d).
• Users ordinarily only have full access to their
home directory (/home/<username>)
• Files don’t have hidden attributes, like
Windows. Instead, all files which begin with a
“.” are “hidden”
4 June 2013 Managed by: Southwest Research Institute
12
Using the Linux Terminal
4 June 2013 Managed by: Southwest Research Institute
13
Using the Linux Terminal
• Similar to Windows command prompt, but “on steroids”
• Essential for developing ROS applications
• Click on the terminal icon to open a terminal
• Open new terminal window
– MenuFileOpen Terminal
– Ctrl+Shift+N
• Terminals can have multiple tabs
– MenuFileOpen Tab
– Ctrl+Shift+T
• You can use * and ? characters as wildcards when
specifying names
4 June 2013 Managed by: Southwest Research Institute
14
Running Commands in Linux
• Terminal opens with
prompt
• Type command, followed
by enter
• Command will run, then
return with prompt
• If command needs to be
“killed”, press Ctrl+C
• Hovering on right side will
show you the scroll bar
• The tab key is your friend!
4 June 2013 Managed by: Southwest Research Institute
15
Standard Commands for Linux
• ls – Lists files and folders. • cp <src> <dest> -
Specifying a file or wild card Copies <src> to <dest>
will show only the files • mv <src> <dest> -
listed Moves/renames <src> to
• ls –a – Lists hidden files <dest>
as well • rm <file> - Removes
• cd <folder> - Changes <file>
the working folder to the • ps ax – Shows all
given folder processes running on
• pwd – Prints the current computer
working folder • kill <pid> - Kills
program with process <pid>
4 June 2013 Managed by: Southwest Research Institute
16