Units 01-14 Assignments (RHEL9)

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/173

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

174 Terms

1
New cards

(3) Describe three reasons you should learn about Linux.

Linux is a critical technology for IT professionals to understand.

Linux is in widespread use, and if you use the internet at all, you are probably already interacting with Linux systems in your daily life.

Linux manages point-of-sale systems and the world's stock markets, and also powers smart TVs and in-flight entertainment systems.

2
New cards

(3) List three ways Linux is used today in modern datacenters.

In application development, Linux hosts the application or its runtime.

In cloud computing, the cloud instances in the private or public cloud environment use Linux

as the operating system.

With mobile applications or the Internet of Things (IoT), the chances are high that the operating system of your device uses Linux.

3
New cards

(5) Explain in detail what open source software is.

Open source software is software with source code that anyone can use, study, modify, and

share.

Some software has source code that only the person, team, or organization that created it can see, or change, or distribute.

Open source software is different. - When the copyright holder provides software under an

open source license, they grant the user the right to run the program and also to view, modify, compile, and redistribute the source royalty-free to others.

Open source promotes collaboration, sharing, transparency, and rapid innovation because it encourages people beyond the original developers to make modifications and improvements to the software and to share it with others.

Just because the software is open source does not mean it is somehow not able to be used or provided commercially.

4
New cards

(1) In Chapter 1 you learned about the Linux CLI. Why is the CLI important in Linux?

It enables easier automation, deployment, and provisioning.

5
New cards

(1) According to Chapter 1, who develops open source software?

Volunteers and the academic community.

6
New cards

(1) In detail describe what Red Hat is.

Red Hat is the world's leading provider of opensource software solutions, using a community-powered approach to reliable and high-performance cloud, Linux, middleware, storage, and virtualization technologies.

7
New cards

(1) What is a Linux distribution?

A Linux distribution is an installable operating system that is constructed from a Linux kernel and that supports user programs and libraries.

8
New cards

(1) Explain the multistage process that Red Hat uses to integrate open source software into RHEL?

Red Hat participates in supporting individual open source projects. It contributes code, developer time, resources, and support, and often collaborates with developers from other Linux distributions, to improve the general quality of software for everyone.

9
New cards

(1) What is Fedora?

Fedora is a community project that produces and releases a free, comprehensive Linux-based operating system.

10
New cards

(1) What is CentOS?

CentOS (Community Enterprise Operating System) was a free and open-source Linux distribution built from the source code of Red Hat Enterprise Linux (RHEL).

11
New cards

(1) What is Red Hat Enterprise Linux?

Red Hat Enterprise Linux is the open source, enterprise-ready, commercially supported Linux distribution that Red Hat provides.

12
New cards

(3) List three ways to "try out" Red Hat Enterprise Linux as detailed in Chapter 1.

RHEL Evaluation Download

Red Hat Developer Subscription

Public Cloud Platforms

13
New cards

(3) What is bash? What is sh? What is the difference between bash and sh?

Bourne-Again Shell

Bourne Shell

Bash is an improved version of one of the most successful shells used on UNIX-like systems, the Bourne Shell (sh).

14
New cards

(1) Explain what is meant by command line.

A command line is a text-based interface which can be used to input instructions to a computer system.

15
New cards

(4) Define these terms:

a. physical console

b. shell

c. terminal

d. virtual console

a. The hardware display and keyboard to interact with a system.

b. The interpreter that executes commands that are typed as strings.

c. An interface that provides a display for output and a keyboard for input to a shell session.

d. One of multiple logical consoles that can each support an independent login session.

16
New cards

(3) List and define the three parts of a Linux command.

Command - The command is the name of the program to run.

Options - Options normally start with one or two dashes (-a or --all) to distinguish them from arguments.

Arguments - Commands may also be followed by one or more arguments, which often indicate a target that the command should operate on.

17
New cards

(1) What does the option --help do? Explain.

This causes the command to print a description of what it does, a "usage statement" that describes the command's syntax, and a list of the options it accepts and what they do.

18
New cards

(2) Explain what a desktop environment is; give examples.

The desktop environment is the graphical user interface on a Linux system.

The default desktop environment in Red Hat Enterprise Linux 8 is provided by GNOME 3.

19
New cards

(6) Define what the following features of the RHEL GNOME desktop provide:

a. Activities Overview

b. dash

c. message tray

d. top bar

e. windows list

f. Workspaces

a. This mode helps to organize windows and to start applications.

b. This configurable list of icons shows your favorite applications, running

applications, and a Show Applications button to select arbitrary applications.

c. With the message tray, you can review notifications from applications

or system components.

d. Provides the Activities button and controls for volume, networking, calendar access, and switching between keyboard input methods (if more than one method is

configured).

e. A list of open windows at the bottom of the screen that lets users quickly

switch between open windows, close them, or drag them to other workspaces.

f. Separate desktop screens that have different application windows.

20
New cards

(1) List the procedure to shut down a RHEL server from the GNOME desktop.

Select (User) → Power Off from the top bar or press Ctrl+Alt+Del.

21
New cards

(1) Who is Bruce Perens?

An American computer programmer and advocate in the free software movement.

22
New cards

(1) Who is Richard Stallman?

An American free software movement activist and programmer.

23
New cards

(1) Who is Linus Torvalds?

A Finnish software engineer who is the creator and lead developer of the Linux kernel.

24
New cards

(1) What is meant by a file system hierarchy?

All files on a Linux system are stored on file systems which are organized into a single inverted tree of directories, known as a file system hierarchy.

25
New cards

(5) What is the purpose of the following Linux directories?

a. /boot

b. /etc

c. /root

d. /usr

e. /var

a. Files needed in order to start the boot process

b. Configuration files specific to this system

c. Home directory for the administrative superuser, root

d. Installed software, shared libraries, include files, and read-only program data

e. Variable data specific to this system that should persist between boots

26
New cards

(2) Explain what an absolute path is. Define a relative path and compare it to an absolute path.

An absolute path is a fully qualified name, beginning at the root ( / ) directory and specifying each subdirectory traversed to reach and uniquely represent a single file.

Like an absolute path, a relative path identifies a unique file, specifying only the path necessary to reach the file from the current working directory.

27
New cards

(4) What do the following Linux commands do?

a. cd

b. ls

c. pwd

d. touch

a. Change directories

b. Lists directory contents for the specified directory or, if no directory is given, for the current directory

c. Displays the absolute path name of the current location, which helps determine appropriate syntax for reaching files using relative path names

d. Normally updates a file's timestamp to the current date and time without otherwise modifying it

28
New cards

(18) Assuming you have the necessary permissions, what behavior would you expect from the following command, option, and argument combinations?

a. cd -

b. cd .

c. cd ../..

d. cd /bin

e. cd home/ringo

f. cd ~

g. cd /bin

h. cp joe mary

i. ls -l

j. ls -l Music Pictures Videos

k. ls -la /docs/IST190

l. ls -R

m. mkdir -p docs/IST190/practice

n. mv mary /tmp/joe

o. mv mystuff ~/oldstuff

p. mv song1.mp3 song2.mp3 sing3.mp3 mymusic

q. rm -tf /tmp

r. touch awesome

a. Changes to the previous working directory

b. Stays in the current directory

c. Moves up two levels in the directory tree

d. Changes to the absolute path

e. Changes to user ringo's home directory using an absolute path

f. Changes to the current user's home directory

g. Changes into a relative path subdirectory named "bin" in the current directory

h. Copies the file "joe" to a new file named "mary" in the current directory

i. Lists directory contents in long listing format

j. Lists the contents of Music, Pictures, and Videos in long listing format, if they exist

k. Lists all files (including hidden files) in /docs/IST190 using long format

l. Recursively lists all files and directories, including their subdirectories

m. Creates the full path of directories. If "docs", "IST190", or "practice" don't exist, they're created

n. Moves (or renames) "mary" to the file path "/tmp/joe"

o. Moves "mystuff" to the "oldstuff" directory in the user's home directory

p. Moves all three songs into the "mymusic" directory

q. Recursively and forcefully removes "/tmp" and everything inside it

r. Creates an empty file named "awesome" or updates its timestamp if it already exists

29
New cards

(7) Define these Linux meta-characters as they apply to file globbing:

a. *

b. ?

c. [[:alpha:]]

d. [[:space:]]

e. [^aeiou]

f. [aeiou]

a. Any string of zero or more characters

b. Any single character

c. Any alphabetic character

d. Any single digit from 0 to 9

e. Any single white space character, which might include tabs, newlines, carriage, returns, form feeds, or spaces

f. Any single character that is NOT a, e, i, o, or u

g. Any single character that is a, e, i, o, or u

30
New cards

(5) Assuming you have the necessary permissions, what behavior would you expect from the

following command, option, and argument combinations?

a. echo "Today is $(date +%A)."

b. ls *.??

c. ls -l [xyz]*

d. ls -la z

e. touch volume {1..2}_chapter{1..6}.txt

a. This command prints the message "Today is ..." followed by the current day of the week.

b. Lists files in the current directory whose names end with a dot (.) followed by exactly two characters.

c. Lists (in long format) all files and directories in the current directory whose names start with a x, y, or z.

d. Lists (in long format, including hidden files) all files and directories in the current directory whose names contain the letter z anywhere in the name.

e. Creates (or updates the timestamp of) a series of files named volume1_chapter1.txt through volume2_chapter6.txt.

31
New cards

(4) Explain the difference between a hard link and a soft link, including the advantages and

disadvantages of both

Even if the original file gets deleted, the contents of the file are still available as long as at least one

hard link exists. Data is only deleted from storage when the last hard link is deleted.

Hard links can only be used with regular files.

A soft link is not a regular file, but a special type of file that points to an existing file or directory.

They can link two files on different file systems.

32
New cards

(1) In your own words define what metacharacters are.

A metacharacter is a character that has a special meaning to a computer program.

33
New cards

10. (1) How do you create a soft (symbolic) link in student's home directory that will link to

/var/www/html/ assuming that all the correct permissions apply.

Run "ln -s /var/www/html ~/html-link"

34
New cards

(3) Write a brief explanation of each of the following:

a. Tilde (~) expansion

b. Brace ({ }) expansion

c. Command substitution ( $(command) )

a. The tilde character, when followed by a slash delimiter, matches the current user's home directory.

Brace expansion is used to generate discretionary strings of characters. Command substitution allows the output of a command to replace the command itself.

35
New cards

(2) What are man pages?

The original Linux Programmer's Manual.

To distinguish identical topic names in different sections, man page references include the section

36
New cards

(9) List the nine different sections that can be found in man pages.

User commands

System calls

Library calls

Special files

File formats

Games and screensavers

Conventions, standards, and miscellaneous

System administration and privileged commands

Linux kernel API

37
New cards

(2) What is the difference between passwd(1) and passwd(5) in the passwd man pages?

passwd(1) describes the command to change passwords.

passwd(5) explains the /etc/passwd file format for storing local user accounts.

38
New cards

(4) When navigating man pages, what key do you press to do the following:

39
New cards

a. Scroll backward (up) one screen

b. Go to start of the man page

c. Scroll forward (down) one screen

d. Exit man and return to the command shell prompt

a. PageUp

b. G

c. Spacebar

d. Q

40
New cards

(1) Write the command to do a keyword search of the man pages for the string samba.

man -k samba

41
New cards

(2) What are GNU Info pages?

The GNU Project developed a different online documentation system, known as GNU info.

Info documentation is structured as hyperlinked info nodes.

42
New cards

(2) What is the difference between man pages and GNU Info pages?

Man pages have a much more formal format.

Info documents typically cover particular software packages as a whole.

43
New cards

(1) What is the RHEL8 tool used to view GNU info pages?

pinfo command

44
New cards

(2) After studying Unit 4, between man pages and GNU Info pages, which one are you more apt to use and why?

I am more apt to use man pages because they are quicker to access, easier to read for specific command syntax, and more universally available across Linux systems.

45
New cards

(1) Explain what a file descriptors do in Linux.

A process uses numbered channels called file descriptors to get input and send output.

46
New cards

(7) Define the following terms from Chapter 5:

a. stdin

b. stdout

c. stderr

d. redirection

e. pipeline

f. pipe

g. tee

a. Standard input

b. Standard output

c. Standard error

d. Sends standard output to files or gets standard input from files

e. A sequence of one or more commands separated by |, the pipe character

f. Connects the standard output of the first command to the standard input of the next command

g. In a pipeline, the tee command copies its standard input to its standard output and also redirects its standard output to the files named as arguments to the command.

47
New cards

(6) What do the following redirection operators do?

a. > file

b. >> file

c. > file 2> file2

d. 2> /dev/null

e. &> file

f. &>> file

a. Redirect stdout to overwrite a file

b. Redirect stdout to append to a file

c. Redirect stderr to overwrite a file

d. Discard stderr error messages by redirecting them to /dev/null

e. Redirect stdout and stderr to overwrite the same file

f. Redirect stdout and stderr to append to the same file

48
New cards

(8) Editing from a command prompt:

a. What is vim?

b. What is the difference between vi and vim?

c. Define the three modes of vim?

d. What is the default mode in vim?

e. What is the keystroke enter insert mode?

f. What is the keystroke to go from insert mode to command mode?

g. What is the keystroke to enter visual mode for a block of text?

h. What is the keystroke to save your files and exit vim?

a. Used to create and edit text files from the command line

b. An improved version of the vi editor distributed with Linux and UNIX systems

c. Edit, command, and visual

d. Command

e. i

f. Esc

g. Ctrl+v

h. :wq

49
New cards

(2) Define and compare what a shell variable is versus an environment variable.

A shell variable is used to help run commands or to modify the behavior of the shell.

An environment variable is automatically copied to programs run from that shell when they start.

50
New cards

(1) How do you expand a bash shell variable?

Use the $ key.

51
New cards

(12) Define these files, directories, variables, and commands?

a. PS1

b. EDITOR

c. HOME

d. LANG

e. PATH

f. env

g. set

h. export

i. unset

j. unexport

k. .bashrc

l. /etc/profile.d

a. A shell variable that controls the appearance of the shell prompt

b. The EDITOR environment variable specifies the program you want to use as your default text editor for command-line programs.

c. Used to help programs determine where to save files

d. Sets the locale

e. Contains a list of colon-separated directories that contain programs

f. Used to list all the environment variables for a particular shell

g. Used to list all shell variables that are currently set

h. Used to make any variable defined in the shell into an environment variable by marking it for export

i. Used to unset and unexport a variable entirely

j. Used to unexport a variable without unsetting it

k. Used to make a change to your user account that affects all your interactive shell prompts at startup

l. The best way to adjust settings that affect all user accounts is by adding a file with a name ending in .sh containing the changes to the /etc/profile.d directory.

52
New cards

(2) In your own words paraphrase Chapter 6 where it asks "What is a user?"

A user is an account that creates security boundaries between people and programs that run commands, with each user having a username and a unique user ID (UID).

There are three main types of users: the superuser (root) who has full access, system users used by services or daemons, and regular users who have limited access for daily tasks.

53
New cards

(7) Explain how to use the following commands from Chapter 6:

a. groupadd

b. id

c. passwd

d. ps au

e. su

f. sudo

g. usermod

a. Used to create groups

b. Used to show information about the currently logged-in user

c. The passwd username command sets the initial password or changes the existing password of username.

d. Used to view the user associated with a process

e. Allows a user to switch to a different user account

f. Allows a user to be permitted to run a command as root, or as another user, based on settings in the /etc/sudoers file

g. Used to modify an account

54
New cards

(7) There are seven fields in the /etc/passwd file for each record. Define them in the proper order:

a. Field 1

b. Field 2

c. Field 3

d. Field 4

e. Field 5

f. Field 6

g. Field 7

a. Username for this user (user01)

b. The user's password used to be stored here in encrypted format. That has been moved to the /etc/shadow file. This field should always be x.

c. The UID for this user account (1000)

d. The GID number for this user account's primary group (1000)

e. The real name for this user (User One)

f. The home directory for this user (/home/user01). This is the initial working directory when the shell starts and contains the user's data and configuration settings.

g. The default shell program for this user, which runs on ligin (/bin/bash). For a regular user, this is normally the program that provides the user's command-line prompt. A system user might use /sbin/nologin if interactive logins are not allowed for that user.

55
New cards

(2) Explain the difference between primary groups and secondary groups.

Every user has one primary group that owns new files they create.

Users can also belong to supplementary groups that give extra access to shared files or resources.

56
New cards

(1) What is a Red Hat User Private Group?

A new group with the same name as that user is created.

57
New cards

(4) Define the four fields found in each record of the /etc/group file.

a. Field 1

b. Field 2

c. Field 3

d. Field 4

a. Group name for this group (group1)

b. Obsolete group password field. This field should always be x.

c. The GID number for this group (10000)

d. A list of users who are members of this group as a supplementary group (user01, user02, user03)

58
New cards

(9) There are nine fields in the /etc/shadow file for each record. Define them in the proper order:

a. Field 1

b. Field 2

c. Field 3

d. Field 4

e. Field 5

f. Field 6

g. Field 7

h. Field 8

i. Field 9

a. Username of the account this password belongs to

b. The encrypted password of the user

c. The day on which the password was last changed. This is set in days since 1970- 01-01, and is calculated in the UTC time zone.

d. The minimum number of days that have to elapse since the last password change before the user can change it again

e. The maximum number of days that can pass without a password change before the password expires. An empty field means it does not expire based on time since the last change.

f. Warning period. The user will be warned about an expiring password when they login for this number of days before the deadline.

g. Inactivity period. Once the password has expired, it will still be accepted for login for this many days. After this period has elapsed, the account will be locked.

h. The day on which the password expires. This is set in days since 1970-01-01, and is calculated in the UTC time zone. An empty field means it does not expire on a particular date.

i. The last field is usually empty and is reserved for future use.

59
New cards

(1) What does the hyphen do in the su - command?

It starts a login shell.

60
New cards

(2) What is found in the /etc/sudoers file? How does it work?

The main configuration file for sudo is /etc/sudoers.

To avoid problems if multiple administrators try to edit it at the same time, it should only be edited with the special visudo command.

61
New cards

(2) Explain the differences between the root user and all other users on a Linux server.

Root is the superuser with full access to everything.

Regular users have limited access and can only do what they're allowed to.

62
New cards

(6) Explain what the following options do when used on the useradd command:

a. -a

b. -G

c. -g

d. -L

e. -s

f. -U

a. Used with the -G option to add the supplementary groups to the user's current set of group memberships instead of replacing the set of supplementary groups with a new set

b. Specify a comma-separated list of supplementary groups for the user account

c. Specify a primary group for the user account

d. Lock the user account

e. Specify a particular login shell for the user account

f. Unlock the user account

63
New cards

(1) What is significant about UID numbers above 1000?

In RHEL7, 8, and 9, the useradd command assigns new users the first free UID greater than or equal to 1000, unless you explicitly specify one using the-u option.

64
New cards

(4) What four things are defaults in the user password policy for a RHEL/CentOS user (hint: /etc/login.defs):

PASS_MAX_DAYS

PASS_MIN_DAYS

PASS_WARN_AGE

UID Range for Regular Users

65
New cards

(3) There are three pieces of information stored in a modern password hash. What are they?

The hashing algorithm used for the password

The salt used to encrypt the password. This is originally chosen at random.

The encrypted hash of the user's password. The salt and the unencrypted password are combined and encrypted to generate the encrypted hash of the password.

66
New cards

(6) Explain what the following options do when used on the chage command:

a. -d

b. -E

c. -I

d. -m

e. -M

f. -W

a. Last change date

b. Password expiration date

c. Inactive days

d. Min days

e. Max days

f. Warm days

67
New cards

(1) What is /sbin/nologin?

Used to block login access for accounts that don't need to log in.

68
New cards

(3) Define and explain the three permissions used in Linux to control access to files (excluding directories).

r(read) - File contents can be read.

w(write) - File contents can be changed.

x(execute) - Files can be executed as commands.

69
New cards

(3) Define and explain the three permissions used in Linux to control access to directories.

If a user only has read access on a directory, the names of the files in it can be listed, but no other information, including permissions or time stamps, are available, nor can they be accessed.

If a user only has exec access on a directory, they cannot list the names of the files in the directory, but if they already know the name of a file which they have permission to read, then they can access the contents of that file by explicitly specifying the file name.

A file may be removed (deleted) by anyone who has writepermission to the directory in which the file resides, regardless of the ownership or permissions on the file itself.

70
New cards

(3) Refer to these permissions and ownerships:

Users and their groups:

lucy lucy,ricardo

ricky ricky,ricardo

ethel ethel,mertz

fred fred,mertz

File attributes (permissions, user & group ownership, name):

drwxrwxr-x ricky ricardo dir (which contains the

following files)

-rw-rw-r-- lucy lucy lfile1

-rw-r--rw- lucy ricardo lfile2

-rw-rw-r-- ricky ricardo rfile1

-rw-r----- ricky ricardo rfile2

a. What are ethel's file permissions?

b. What is lucy's access permissions to rfile1?

c. Let's assume Sheldon has an account on this Linux server and is not a member of any of these groups, what access does Sheldon have to 1file2 and rfile2?

a. Ethel does not own any of these files, nor do ethel's groups (ethel, mertz) have ownership. Therefore, ethel gets the 'other' permissions:

ethel can read lfile1 and rfile1

ethel can read/write lfile2

ethel has no access to rfile2. It can be listed because the other permissions on the directory are r-x, but ethel cannot open the file.

b. lucy is in the ricardo group which owns rfile1. Therefore lucy has read/write permission on rfile1.

c. Sheldon is not the owner of those files, and not in the ricardo group. Therefore, Sheldon has other privileges:

Sheldon can read rfile1

Sheldon has no access to rfile2

71
New cards

(1) What is the command to add write permissions to all group owners below /var/www/html/ist190/ on a Linux webserver, including directories and files? Follow the suggestion in the chapter.

chmod -R g+w /var/www/html/ist190/

72
New cards

(1) What is the command using octal notation to changer the permissions on /var/www/html/ist190/index.html so that the user owner has RWX, the group has RX, and the world has R?

chmod 754 /var/www/html/ist190/index.html

73
New cards

(1) What is the most efficient and fastest way to change the user owner to ist190student and the group owner to wheel for all files and directories under /var/www/html/ist190/ on a Linux webserver?

chown -R ist190student:wheel /var/www/html/ist190/

74
New cards

(1) You have been asked to setup a collaborative directory for all members of the music group at /data/musicgroup/ on your fileserver. What is the command to set create these special permissions (sgid)?

chmod g+s /data/musicgroup/

75
New cards

(2) What is the purpose of the sticky bit? How do you set it?

The sticky bit restricts deletion of a file to the owner or root.

chmod +t directory_name

76
New cards

(3) What is an umask and how does it work? Show examples of how changing the umask affects files and directories.

An octal bitmask that is used to clear the permissions of new files and directories that are created by the process.

The previous umask, 0002, clears the write bit for other users.

A umask of 077 clears all the group and other permissions of newly created files.

77
New cards

(2) What file has to be modified to change the default umask for ALL users who log in to your Linux server? Give an example.

/etc/profile and /etc/bashrcfiles.

Add umask 022 to /etc/profile

78
New cards

(5) According to Chapter 8, what is a process? Include at least four characteristics.

A process is a running instance of a launched, executable program, which consists of:

an address space of allocated memory

security properties including ownership credentials and privileges

one or more execution threads of program code

the process state

79
New cards

(4) Explain what happens when a new process starts on a Linux server, excluding PID 1.

An existing (parent) process duplicates its own address space (fork) to create a new (child) process structure.

Through the fork routine, a child process inherits security identities, previous and current file descriptors, port and resource privileges, environment variables, and program code.

A child process may then exec its own program code.

Normally, a parent process sleeps while the child process runs, setting a request (wait) to be signaled when the child completes.

80
New cards

(5) Explain the FIVE states that a process can go through (two different kinds of Sleep).

R: Running - The process is executing user or kernel routines, or "queued" and waiting to run

Sleeping - There are different types of sleeping:

S: Interruptible - process is waiting for some condition or a signal to run

D: Uninterruptible - also sleeping, but does not respond to signals

K: Killable - same as D, but modified to respond to a kill signal

I: Idle - subset of D, used for kernel threads

T: Stopped - The process is stopped (suspended); can be resumed by another signal

Zombie - Z: EXIT_ZOMBIE: child signals to parents as it completes; resources released

X: EXIT_DEAD: After parent cleans up resources, the process is released completely; no more PID

81
New cards

(1) What does the command ps aux do on a RHEL server?

without options, 'ps' shows the processes running under the logged in user from the current terminal.

-a prints the running processes from all users

-u includes the user or owner column in the output

-x prints processes running in the system regardless of where they were executed

Consider the effect of 'x':

82
New cards

(1) Most modern operating systems have some sort of job control system. Explain what this is on a Linux server.

Job control is a feature of the shell which allows a single shell instance to run and manage multiple commands.

83
New cards

(4) What is the difference between a background process and a foreground process? Why is this important to a Sys Admin?

Processes that are part of that job are foreground processes of that controlling terminal.

Foreground processes can read input and receive keyboard-generated signals from a terminal.

Background processes cannot read input or receive those signals, but may write to the terminal.

If a background process tries to read from the terminal, it is suspended.

This is important for sysadmins to manage terminal interactions and multitasking.

84
New cards

(1) What command should I enter run copy hugefile to bigfile in the background?

cp hugefile bigfile &

85
New cards

(1) What command do I run to see a list of the currently running background processes?

jobs

86
New cards

(2) Explain the difference between the commands kill -15 PID and kill-9 PID.

kill -9 is "KILL, unblockable" - it causes abrupt process termination and cannot be blocked, ignored, or handled

kill -15 is "TERM: terminate" - it asks the program to terminate, allowing it to complete operations and clean up before terminating.

87
New cards

(2) What do the commands killall and pkill do?

The killall command can signal multiple processes, based on their command name.

Use pkill to send a signal to one or more processes which match selection criteria.

88
New cards

(2) What is the difference between tty and pts/0 in the output of the ps command?

tty means that the user is on a physically connected terminal device

pts means that the user is connected through a "pseduo-terminal" via graphical window or remote login session

89
New cards

(2) What do the commands pgrep and pstree do?

Use the pgrep command to identify the PID numbers to kill.

Use the pstree command to view a process tree for the system or a single user.

90
New cards

(4) Explain what load average is.

Load average is a measurement provided by the Linux kernel that is a simple way to represent the perceived system load over time.

It can be used as a rough gauge of how many system resource requests are pending, and to determine whether system load is increasing or decreasing over time.

Every five seconds, the kernel collects the current load number, based on the number of processes in runnable and uninterruptible states.

This number is accumulated and reported as an exponential moving average over the most recent 1, 5, and 15 minutes.

91
New cards

(2) What two commands can you use to see the current load average of a Linux server?

uptime

top

92
New cards

(1) What is a Linux daemon?

Processes that wait or run in the background performing various tasks

93
New cards

(1) What is systemd in RHEL/CentOS?

It provides a method for activating system resources, server daemons, and other processes, both at boot time and on-demand on a running system.

94
New cards

(1) When referring to daemons, what is a socket? (Refer to class lecture)

To listen for connections, a daemon uses a socket.

95
New cards

(1) What is a service in Linux?

One or more daemons.

96
New cards

(2) During the class lecture we learn a "bit of history" about daemon management in RHEL.

What two previous daemon management systems were used prior to RHEL7/CentOS7?

Frequently used daemons were started on systems at boot time with System V and LSB init scripts.

Less frequently used daemons were started on-demand by another service, such as initd or xinetd (sometimes called super-servers), which listens for client connections.

97
New cards

(4) What are four features of the systemd init system in RHEL9/CentOS9?

Parallelization capabilities

On-demand starting of daemons

Automatic service dependency management

A method of tracking related processes together by using Linux "control groups

98
New cards

(2) What does the systemctl command do? Which user(s) on your server are allowed to use systemctl?

Manage different types of systemd objects, called units

Root user (with the sudo command if necessary)

99
New cards

(3) Explain the three "common unit types" discussed in the class lecture.

Load - Whether systemd properly parsed the unit's configuration and loaded the unit into memory.

Active - The high-level activation state of the unit. This information indicates whether the unit has started successfully or not.

Sub - The low-level activation state of the unit. This information indicates more detailed information about the unit. The information varies based on unit type, state, and how the unit is executed.

100
New cards

(1) What is xinetd and initd?

Sometimes called super-servers