SLIDE 1 Chapter 2 Getting Started
marjan.trutschl@lsus.edu Louisiana State University, Shreveport, LA 71115
SLIDE 2
Introducing Shells
¤ Conventions and Logging In ¤ Working from the Command Line ¤ su/sudo: Curbing Your Power (root Privileges) ¤ man/info/--help: Displaying Information and Manuals ¤ Logins and Passwords
SLIDE 3 Conventions and Logging In
¤ Conventions
¤ The textbook uses certain conventions, but we’ll avoid those with real examples for clarity
¤ Logging In
¤ Use PuTTy, Mac OS X Terminal, or your own flavor of Linux ¤ Try logging in to your Sun account username@sun.cs.lsus.edu ¤ If your machine has the same username, then it may be
¤ By default, the Raspberry Pi is pi@raspberry and the password is raspberry
SLIDE 4
Logging In
SLIDE 5
Working from the Command Line
¤ Some Commands to Get You Started
¤ The command line is very specific about syntax, always double check your spelling, spaces and capitalization ¤ The below commands tell you which shell you are running and where your shell is located
SLIDE 6
Working from the Command Line
¤ Some More Commands to Get You Started
¤ Pressing ‘control z’ will suspend a program, or use –TERM (or even –KILL if things are getting really ugly) ¤ Use the arrows to repeat commands, or edit the last thing you tried to do ¤ ‘nano’ is a text editor that works via the command line, use it by specifying the file to use or create after ‘nano’ ¤ ‘cat’ simply sends the text output to the command line ¤ ‘tac’ is cat, but backwards…seriously ¤ ‘echo’ just repeats things and ‘rev’ reverses them
SLIDE 7
Working from the Command Line
SLIDE 8
Curbing Your Power
¤ Super User Commands
¤ root is the user level with complete access to the system ¤ Using the keyword ‘sudo’ will run a single command as root ¤ Logging in as ‘su’ enables the root user login ¤ You can really mess things up here; use only when needed ¤ The below commands give access to Wi-Fi configurations on the Raspberry Pi:
SLIDE 9 Displaying Information and Manuals
¤ Your System: It’s Here To Help
¤ Find all kinds of information, directly from the system, unless you think the Internet is more reliable and full of facts ¤ ‘man’ shows basic information for the operation of a utility ¤ ‘info’ displays an interactive guide ¤ ‘--help’ provides a short list of common commands ¤ Since ‘man’ and ‘info’ are utilities, they take a search term as an argument; ‘--help’ is an argument to most utilities.
Before you get frustrated with a utility, read the man page. It actually helps sometimes.
SLIDE 10
Logins and Passwords
¤ Logins
¤ Using the same username between different systems can simplify your login ¤ Also try ‘adduser’ and ‘userdel’ for user management
¤ Passwords
¤ Don’t use the same password, that simplifies cracking your system ¤ Use the ‘passwd’ command to change passwords
SLIDE 11 Logins and Passwords
- The Raspberry Pi is perfect
for this, since you have full admin rights on your machine and it’s cheap if you break it.
- Notice the structure of the
syntax in these commands:
- -’sudo’ is a modifier that
specifies access
- -’userdel’ is a utility that
acts like a command
- -’-r’ is an option, which is
interpreted by the utility
argument, specified for the utility to act upon
SLIDE 12
Exercise
¤ 1. Using the Raspberry Pi, create a new user. ¤ 2. Give the new user root privileges. ¤ 3. Change the user’s password using the pwgen utility. ¤ 4. Delete the user.
SLIDE 13
Work Cited
¤ Sobell, Mark G. "Getting Started." A Practical Guide to Linux Commands, Editors, and Shell Programming. Upper Saddle River, NJ: Prentice Hall/Pearson, 2013. N. pag. Print.