Académique Documents
Professionnel Documents
Culture Documents
Prepared: 8/22/2012
Chapter 1: Logging In
Key Concepts In Linux, user sessions are started by "logging in" to the machine. To login, you must have already been provided a username and password. If a Linux machine is running an X server, users may login using the graphical interface. Users may login on any of six virtual consoles. The CTRL-ALT-F2 through CTRL-ALT-F6 key sequences switch between the six virtual consoles. The CTRL-ALT-F1 key sequence switches to the default X server. If a Linux machine supports it, users can login in over the network using a remote shell. The who command lists which users are currently logged in, and how they logged on.
120822 Workbook 1 2
Linux Essentials
(RHA030)
IST190:
Workbook 1:
Quick Tour
120822
Workbook 1 1
Chapter 1: Logging In
To login, a user types their username, with no spaces, and hits the RETURN key. Next, the user is prompted for their password, which is not echoed to the screen as the user types it, again followed by RETURN. Once successfully logged in, the user is greeted with a shell prompt.
120822
Workbook 1 3
120822
Workbook 1 4
Chapter 1: Logging In
The rest of this course is about what can be done from the shell prompt. You end a session, by typing "exit", and hitting RETURN. The virtual console should return to the original login screen.
Chapter 1: Logging In
Why would users want to use a virtual console instead of the graphical environment? First, the machine might not have enough memory or hardware to support the graphical environment, and the virtual consoles might be all that are available. Virtual consoles are often a much quicker and more efficient interface for experienced users. Because they are implemented by the Linux kernel directly, they are also useful in debugging systems where the graphics might not be working. Lastly, for network servers that usually spend their lives in locked closets, administrators often want to avoid the complexity that the graphical interface adds to the system.
120822
Workbook 1 5
120822
Workbook 1 6
Prepared: 8/22/2012
120822
Workbook 1 7
120822
Workbook 1 8
120822
Workbook 1 9
120822
Workbook 1 10
120822
Workbook 1 11
120822
Workbook 1 12
Prepared: 8/22/2012
The first column lists the users who have logged on, and the last few columns the time that they logged on. For the first two users, elvis, and root, tty1 and tty2 refers to virtual consoles number 1 and 2, respectively. The first entry for blondie, :0, refers to the X server itself, and pts/0 refers to the first terminal opened within the X server. We can see that elvis is logged on the second virtual console, root on the first, and blondie has logged in using the graphical environment.
Workbook 1 13 120822 Workbook 1 14
120822
120822
Workbook 1 15
120822
Workbook 1 16
120822
Workbook 1 17
120822
Workbook 1 18
Prepared: 8/22/2012
120822
Workbook 1 19
120822
Workbook 1 20
The first column shows the process's PID, or Process ID. Every process running on the system is identified by a unique PID. The second column identifies elvis's terminal, and the third column reports how much CPU time the process has consumed.
120822
Workbook 1 21
120822
Workbook 1 22
120822
Workbook 1 23
120822
Workbook 1 24
Prepared: 8/22/2012
120822
Workbook 1 25
120822
Workbook 1 26
120822
Workbook 1 27
120822
Workbook 1 28
120822
Workbook 1 29
120822
Workbook 1 30
Prepared: 8/22/2012
120822
Workbook 1 31
120822
Workbook 1 32
The user elvis has encountered another common Linux concept, that of file ownerships and permissions. elvis tried to create the new file /etc/lsout.txt, but elvis does not have permissions to create files in the /etc directory. By default, in Red Hat Enterprise Linux, users can only create files in their home directories and the shared /temp directory.
120822
Workbook 1 33
120822
Workbook 1 34
120822
Workbook 1 35
120822
Workbook 1 36
Prepared: 8/22/2012
Chapter 4: Commands
The first word on any command is generally the name of a program that lives as a file somewhere in the filesystem. For example, the previous lessons used the ps and who commands. If we want to know which file contains these programs, there is a program called which, which can help us. The which command, followed by the name of another command, will tell you "which" file is being run.
Chapter 4: Commands
When running a command, the shell process asks the kernel to execute the specified program as a separate process Then the shell arranges the output (or, more correctly, the standard out stream) of the process to be written to the terminal. The shell then pauses until the command's process terminates. Once the command finishes, the shell prints another prompt, and waits to be told what to do next.
120822
Workbook 1 37
120822
Workbook 1 38
120822
Workbook 1 39
120822
Workbook 1 40
All of the single letter switches that don't take an argument, in this case -s and -r, can be piled together, sharing a single -. If a switch does take an argument, such as -w 40, it can only share a hyphen if it comes last. That way, its argument can be specified next on the command line.
120822
Workbook 1 41
120822
Workbook 1 42
Prepared: 8/22/2012
Chapter 4: Arguments
Compared to command line switches, arguments are easy. Whatever words are left over on the command line, after the command name and after any command line switches, are called arguments to the command. What a command expects as arguments, or if it expects any at all, depend on the command. For example, the ls command, if given argument, will treat the arguments as the files or directories to be listed. The ps command expects no arguments. The cal command takes from zero to two, a possible month and a possible year to generate the calendar for.
120822
Workbook 1 43
120822
Workbook 1 44
120822
Workbook 1 45
120822
Workbook 1 46
120822
Workbook 1 47
120822
Workbook 1 48
Prepared: 8/22/2012
120822
Workbook 1 49
120822
Workbook 1 50
120822
Workbook 1 51
120822
Workbook 1 52
120822
Workbook 1 53
120822
Workbook 1 54
Prepared: 8/22/2012
120822
Workbook 1 55
120822
Workbook 1 56
120822
120822
Workbook 1 58
120822
Workbook 1 59
120822
Workbook 1 60
10
Prepared: 8/22/2012
120822
Workbook 1 61
120822
Workbook 1 62
120822
Workbook 1 63
120822
Workbook 1 64
120822
Workbook 1 65
120822
Workbook 1 66
11
Prepared: 8/22/2012
120822
Workbook 1 67
120822
Workbook 1 68
HOWTOs
GUIDES
While the documentation is not specific to the Red Hat Enterprise Linux distribution, much of the information is still useful and relevant.
Workbook 1 69 120822 Workbook 1 70
120822
120822
Workbook 1 71
120822
Workbook 1 72
12
Prepared: 8/22/2012
Workbook 1: Assessments
Chapter Review Questions Assignment
https://moodle.beausanders.org
Pretest Practice Test, does not count 10 Multiple Answer Questions https://moodle.beausanders.org Test 20 Multiple Answer Questions = Test Grade https://moodle.beausanders.org
120822
Workbook 1 73
13