ch2: Basic Commands and Directory Hierarchy Flashcards

(45 cards)

1
Q

Globbing

A

the shell matches simple patterns to file and directory names.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

The glob character

A

*
footnote: tells the shell to match any number of arbitrary characters

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

instructs the shell to match exactly one arbitrary character

A

?

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

When does expansion occur?

A

Before a command is run

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Command used to assign an environment variable

A

export

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

PATH variable

A

A special environment variable that contains the command path, a list of system directories that the shell searches when trying to locate a command.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Standard Error (stderr)

A

An output stream for diagnostics and debugging

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Stream ID of stderr?

A

2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How to redirect standard error?

A

2>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a downside of the bg command?

A

A backgrounded process may need to read from STDIN, causing the process to freeze.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How to redirect the output of a backgrounded process

A

bg > /dev/null

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

File permission mode user order

A

User (owner of the file), Group, Other

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

A file that points to another file or directory

A

symbolic link

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How to create a symbolic link?

target = directory to the symbolic link points to
linkname = the name of the symbolic link

A

ln -s target linkname

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

One common use case of _____ _____ is when
a program expects to find a particular file or directory that already exists
somewhere else on your system. You don’t want to make a copy, and if you
can’t change the program, you can just create a _____ _____ from it to the
actual file or directory location.

A

symbolic links

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the file extension for a compressed archive?

A

.tar.gz

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What does the /bin directory contain?

A

Ready-to-run programs (executables), including basic Unix commands such as ls and cp

Most programs in /bin are in binary format created by a C compiler, but some are shell scripts.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is the purpose of the /dev directory?

A

Contains device files

You’ll learn more about these in Chapter 3.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What type of files does the /etc directory hold?

A

User password, boot, device, networking, and other setup files

This directory is core to system configuration.

20
Q

What is stored in the /home directory?

A

Home (personal) directories for regular users

Most Unix installations conform to this standard.

21
Q

What does the /lib directory contain?

A

Library files containing code that executables can use

There are static and shared libraries; /lib should only contain shared libraries.

22
Q

What is the function of the /proc directory?

A

Provides system statistics through a browsable directory-and-file interface

Contains information about currently running processes and some kernel parameters.

23
Q

What type of data is found in the /run directory?

A

Runtime data specific to the system, including process IDs, socket files, and status records

This is a recent addition to the root directory.

24
Q

How is the /sys directory similar to /proc?

A

Both provide a device and system interface

More details will be discussed in Chapter 3.

25
What is the primary use of the /sbin directory?
Contains system executables related to system management ## Footnote Regular users usually do not have /sbin components in their command paths.
26
What is the purpose of the /tmp directory?
A storage area for smaller, temporary files ## Footnote Users can read and write, but cannot access another user's files. It is cleared on boot.
27
What does the /usr directory contain?
A large directory hierarchy, including the bulk of the Linux system ## Footnote Many directory names in /usr are the same as those in the root directory.
28
What is the /var directory used for?
Where programs record information that can change over time ## Footnote Contains system logging, user tracking, and caches.
29
True or False: The /var/tmp directory is wiped on boot.
False ## Footnote The system does not wipe /var/tmp on boot.
30
Fill in the blank: The /lib directory holds _______ files.
library
31
What files are contained in the /boot directory?
Kernel boot loader files related to the initial stage of the Linux startup procedure. ## Footnote Information about how Linux starts up its services is not found in this directory.
32
What is the purpose of the /media directory?
It serves as a base attachment point for removable media such as flash drives. ## Footnote This directory is commonly found in many distributions.
33
What type of software may be found in the /opt directory?
Additional third-party software. ## Footnote Many systems do not utilize the /opt directory.
34
What resides in the /usr directory?
Most user-space programs and data. ## Footnote This includes subdirectories like /usr/bin, /usr/sbin, and /usr/lib.
35
What does the /usr/include directory hold?
Header files used by the C compiler.
36
What is the purpose of the /usr/local directory?
A location where administrators can install their own software.
37
What type of content is found in the /usr/man directory?
Manual pages.
38
What does the /usr/share directory contain?
Files that should work on other kinds of Unix machines without loss of functionality. ## Footnote These are usually auxiliary data files read by programs and libraries.
39
What is the typical name of the kernel binary file in Linux systems?
/vmlinuz or /boot/vmlinuz.
40
What is the role of the boot loader in relation to the kernel?
It loads the kernel binary file into memory and initiates it during system boot.
41
Where are loadable kernel modules located?
/lib/modules.
42
True or False: The main kernel file is used by the running system after the boot loader starts it.
False.
43
Fill in the blank: The /usr directory contains user-space programs and data, including /usr/bin, /usr/sbin, and _______.
/usr/lib.
44
What file controls which users have sudo access?
/etc/sudoers
45
What file contains users on the systems?
/etc/passwd