Embedded Programming and Robotics Lesson 13 Basic Linux

advertisement
Embedded Programming and
Robotics
Lesson 13
Basic Linux
Basic Linux
1
Introduction
• Linux is an open-source operating system
• You have already installed it on your MicroSD card, so there is no
need to go into the details of a real install
• Much of what we’ll do is either in Python or will use the graphical
shell
• It helps to know some basic concepts and commands
• Open a command shell on your Pi and follow along
Basic Linux
2
The Superuser
• To prevent problems with malware, Linux requires some functions to
be executed as the “superuser”
• Even if your ID has superuser priveleges, commands won’t be
executed as the superuser unless you prefix them with “sudo”
• For example, access to the GPIO pins requires superuser rights
Basic Linux
3
Basic Commands
• man – show documentation
• ls – List the directory
• cd – change directory
• cp – copy a file
• mv – Move or rename a file
• mkdir – create a new directory
• rmdir – remove a directory
• rm – remove (delete) files
• chmod – change file permissions
Basic Linux
4
Advanced Commands
• ifconfig – get network configuration
• iwconfig – get wireless network configuration
Basic Linux
5
man Command
• This is the most important one, since it gives you help on all of the
others
• For example, man ls gives you help on the ls command
• Just typing man will give you a message that you need to request info
on a specific command
Basic Linux
6
ls Command
• List the contents of a directory
• Just typing the command shows the current directory
• ls-l shows the long form, one entry per line
• ls followed by the name of a directory lists the contents of that
directory: ls /etc/
Basic Linux
7
cd Command
Basic Linux
8
cp Command
Basic Linux
9
mv Command
Basic Linux
10
mkdir Command
Basic Linux
11
rmdir Command
Basic Linux
12
rm Command
Basic Linux
13
chmod Command
Basic Linux
14
ifconfig Command
Basic Linux
15
iwconfig Command
Basic Linux
16
Leafpad Text Editor
• This works pretty much the way Notepad works on Windows
Basic Linux
17
Download