adds test
This commit is contained in:
parent
ca40bd050b
commit
9958b5a185
|
@ -8,23 +8,23 @@
|
||||||
## Review Questions
|
## Review Questions
|
||||||
|
|
||||||
1. Which of the following is **not** a function of the Linux kernel?
|
1. Which of the following is **not** a function of the Linux kernel?
|
||||||
* Allocating memory for use by programs
|
* A) Allocating memory for use by programs
|
||||||
* Allocating CPU time for use by programs
|
* B) Allocating CPU time for use by programs
|
||||||
* Creating menus in GUI programs
|
* C) Creating menus in GUI programs
|
||||||
* Controlling access to the hard disk
|
* D) Controlling access to the hard disk
|
||||||
* Enabling programs to use a network
|
* E) Enabling programs to use a network
|
||||||
2. Which of the following is an example of an embedded Linux OS?
|
2. Which of the following is an example of an embedded Linux OS?
|
||||||
* Android
|
* A) Android
|
||||||
* SUSE
|
* B) SUSE
|
||||||
* CentOS
|
* C) CentOS
|
||||||
* Debian
|
* D) Debian
|
||||||
* Fedora
|
* E) Fedora
|
||||||
3. Which of the following is a notable difference between Linux and Mac OS X?
|
3. Which of the following is a notable difference between Linux and Mac OS X?
|
||||||
* Linux can run common GNU programs, whereas OS X cannot.
|
* A) Linux can run common GNU programs, whereas OS X cannot.
|
||||||
* Linux's GUI is based on the X Window System, whereas OS X's is not.
|
* B) Linux's GUI is based on the X Window System, whereas OS X's is not.
|
||||||
* Linux cannot run on Apple Macintosh hardware, whereas OS X can run only on Apple hardware.
|
* C) Linux cannot run on Apple Macintosh hardware, whereas OS X can run only on Apple hardware.
|
||||||
* Linux relies heavily on BSD software, whereas OS X uses no BSD software.
|
* D) Linux relies heavily on BSD software, whereas OS X uses no BSD software.
|
||||||
* Linux supports text-mode commands, but OS X is a GUI-only OS.
|
* E) Linux supports text-mode commands, but OS X is a GUI-only OS.
|
||||||
4. True or false: The Linux kernel is derived from the BSD kernel.
|
4. True or false: The Linux kernel is derived from the BSD kernel.
|
||||||
5. True or false: If you log into a Linux system in graphical mode, you cannot use text-mode commands in that session.
|
5. True or false: If you log into a Linux system in graphical mode, you cannot use text-mode commands in that session.
|
||||||
6. True or false: CentOS is a Linux distribution with a long release cycle.
|
6. True or false: CentOS is a Linux distribution with a long release cycle.
|
||||||
|
@ -42,23 +42,23 @@
|
||||||
## Review Questions
|
## Review Questions
|
||||||
|
|
||||||
1. What type of multitasking does Linux use?
|
1. What type of multitasking does Linux use?
|
||||||
* Preemptive
|
* A) Preemptive
|
||||||
* Multi-user
|
* B) Multi-user
|
||||||
* Co-operative
|
* C) Co-operative
|
||||||
* Single-tasking
|
* D) Single-tasking
|
||||||
* Single-user
|
* E) Single-user
|
||||||
2. Which of the following is a characteristic of all open source software?
|
2. Which of the following is a characteristic of all open source software?
|
||||||
* The software cannot be sold for a profit; it must be distributed free of charge.
|
* A) The software cannot be sold for a profit; it must be distributed free of charge.
|
||||||
* It must be distributed with both source code and binaries.
|
* B) It must be distributed with both source code and binaries.
|
||||||
* Users are permitted to redistribute altered versions of the original software.
|
* C) Users are permitted to redistribute altered versions of the original software.
|
||||||
* The software was originally written at a college or university.
|
* D) The software was originally written at a college or university.
|
||||||
* The software must be written in an interpreted language that requires no compilation.
|
* E) The software must be written in an interpreted language that requires no compilation.
|
||||||
3. Which of the following programs is **most** likely to be installed and regularly used on a desktop computer that runs Linux?
|
3. Which of the following programs is **most** likely to be installed and regularly used on a desktop computer that runs Linux?
|
||||||
* Apache
|
* A) Apache
|
||||||
* Postfix
|
* B) Postfix
|
||||||
* Android
|
* C) Android
|
||||||
* Evolution
|
* D) Evolution
|
||||||
* BIND
|
* E) BIND
|
||||||
4. True or false: VMS was a common OS on x86 PCs at the time Linux was created.
|
4. True or false: VMS was a common OS on x86 PCs at the time Linux was created.
|
||||||
5. True or false: Some DVRs run Linux.
|
5. True or false: Some DVRs run Linux.
|
||||||
6. True or false: A Linux computer being used as a server generally does not require X.
|
6. True or false: A Linux computer being used as a server generally does not require X.
|
||||||
|
@ -76,23 +76,23 @@
|
||||||
## Review Questions
|
## Review Questions
|
||||||
|
|
||||||
1. Which of the following is **not** required in order for software to be certified as open source?
|
1. Which of the following is **not** required in order for software to be certified as open source?
|
||||||
* The license must not discriminate against people or groups of people.
|
* A) The license must not discriminate against people or groups of people.
|
||||||
* The license must not require that the software be distributed as part of a specific product.
|
* B) The license must not require that the software be distributed as part of a specific product.
|
||||||
* The license must require that changes be distributed under the same license.
|
* C) The license must require that changes be distributed under the same license.
|
||||||
* The program must come with source code, or the author must make it readily available on the Internet.
|
* D) The program must come with source code, or the author must make it readily available on the Internet.
|
||||||
* The license must automatically apply to anybody who acquires the software.
|
* E) The license must automatically apply to anybody who acquires the software.
|
||||||
2. Which is true of Linux distributions as a whole?
|
2. Which is true of Linux distributions as a whole?
|
||||||
* They're covered by the GPL or the BSD license, depending on the distribution.
|
* A) They're covered by the GPL or the BSD license, depending on the distribution.
|
||||||
* Sometimes, they may not be copied because of non-open source software they may contain.
|
* B) Sometimes, they may not be copied because of non-open source software they may contain.
|
||||||
* They may be copied only after software using the MIT license is removed.
|
* C) They may be copied only after software using the MIT license is removed.
|
||||||
* They all completely conform to the principles of the open source movement.
|
* D) They all completely conform to the principles of the open source movement.
|
||||||
* They all qualify as free software, as the FSF uses the term.
|
* E) They all qualify as free software, as the FSF uses the term.
|
||||||
3. Which of the following is a key part of the FSF's philosophy?
|
3. Which of the following is a key part of the FSF's philosophy?
|
||||||
* Developers should use the latest version of the FSF's GPL.
|
* A) Developers should use the latest version of the FSF's GPL.
|
||||||
* Users should have the right to modify free software and distribute it under a commercial license.
|
* B) Users should have the right to modify free software and distribute it under a commercial license.
|
||||||
* Developers should write software only for free operating systems such as GNU/Linux.
|
* C) Developers should write software only for free operating systems such as GNU/Linux.
|
||||||
* Users should engage in civil disobedience by copying proprietary software.
|
* D) Users should engage in civil disobedience by copying proprietary software.
|
||||||
* Users must have the right to use software as they see fit.
|
* E) Users must have the right to use software as they see fit.
|
||||||
4. True or false: Copyright law governs the distribution of software in most countries.
|
4. True or false: Copyright law governs the distribution of software in most countries.
|
||||||
5. True or false: The FSF's free software definition and the OSI's ten principles of open source software both require that users have the ability to examine a program's workings---that is, its source code.
|
5. True or false: The FSF's free software definition and the OSI's ten principles of open source software both require that users have the ability to examine a program's workings---that is, its source code.
|
||||||
6. True or false: Because their hardware designs are proprietary, hardware vendors cannot release open source drivers for their products.
|
6. True or false: Because their hardware designs are proprietary, hardware vendors cannot release open source drivers for their products.
|
||||||
|
@ -110,23 +110,23 @@
|
||||||
## Review Questions
|
## Review Questions
|
||||||
|
|
||||||
1. Which of the following are Linux desktop environments? (Select all that apply.)
|
1. Which of the following are Linux desktop environments? (Select all that apply.)
|
||||||
* GTK+
|
* A) GTK+
|
||||||
* GNOME
|
* B) GNOME
|
||||||
* KDE
|
* C) KDE
|
||||||
* Evolution
|
* D) Evolution
|
||||||
* Xfce
|
* E) Xfce
|
||||||
2. If you want to enable one Linux computer to access files stored on another Linux computer's hard disk, which of the following network protocols is the *best* choice?
|
2. If you want to enable one Linux computer to access files stored on another Linux computer's hard disk, which of the following network protocols is the *best* choice?
|
||||||
* SMTP
|
* A) SMTP
|
||||||
* NFS
|
* B) NFS
|
||||||
* PHP
|
* C) PHP
|
||||||
* DNS
|
* D) DNS
|
||||||
* DHCP
|
* E) DHCP
|
||||||
3. In which of the following languages was most of the Linux kernel written?
|
3. In which of the following languages was most of the Linux kernel written?
|
||||||
* Bash shell script
|
* A) Bash shell script
|
||||||
* Java
|
* B) Java
|
||||||
* C
|
* C) C
|
||||||
* C++
|
* D) C++
|
||||||
* Perl
|
* E) Perl
|
||||||
4. True or false: OpenOffice.org and LibreOffice are very similar office suites.
|
4. True or false: OpenOffice.org and LibreOffice are very similar office suites.
|
||||||
5. True or false: Servers can be disrupted by malicious outsiders even if the computer that runs them is never broken into.
|
5. True or false: Servers can be disrupted by malicious outsiders even if the computer that runs them is never broken into.
|
||||||
6. True or false: Python is generally implemented as an interpreted language.
|
6. True or false: Python is generally implemented as an interpreted language.
|
||||||
|
@ -144,23 +144,23 @@
|
||||||
## Review Questions
|
## Review Questions
|
||||||
|
|
||||||
1. Which of the following commands provides the most information about your motherboard's features?
|
1. Which of the following commands provides the most information about your motherboard's features?
|
||||||
* `lscpu`
|
* A) `lscpu`
|
||||||
* `Xorg -configure`
|
* B) `Xorg -configure`
|
||||||
* `fdisk -l /dev/sda`
|
* C) `fdisk -l /dev/sda`
|
||||||
* `lspci`
|
* D) `lspci`
|
||||||
* `http://localhost:631`
|
* E) `http://localhost:631`
|
||||||
2. Why might you want to partition a hard disk? (Select all that apply.)
|
2. Why might you want to partition a hard disk? (Select all that apply.)
|
||||||
* To install more than one OS on the disk
|
* A) To install more than one OS on the disk
|
||||||
* To use ext4fs rather than ReiserFS
|
* B) To use ext4fs rather than ReiserFS
|
||||||
* To turn a PATA disk into an SATA disk
|
* C) To turn a PATA disk into an SATA disk
|
||||||
* To separate filesystem data from swap space
|
* D) To separate filesystem data from swap space
|
||||||
* To separate the disk's cache from its main data
|
* E) To separate the disk's cache from its main data
|
||||||
3. Which of the following devices is *not* commonly attached via USB?
|
3. Which of the following devices is *not* commonly attached via USB?
|
||||||
* Video monitors
|
* A) Video monitors
|
||||||
* Keyboards
|
* B) Keyboards
|
||||||
* External hard disks
|
* C) External hard disks
|
||||||
* Printers
|
* D) Printers
|
||||||
* Scanners
|
* E) Scanners
|
||||||
4. True or false: An EM64T CPU is capable of running a Linux distribution identified as being for the AMD64 CPU.
|
4. True or false: An EM64T CPU is capable of running a Linux distribution identified as being for the AMD64 CPU.
|
||||||
5. True or false: UDF is a good filesystem to use for a Linux installation on a hard disk.
|
5. True or false: UDF is a good filesystem to use for a Linux installation on a hard disk.
|
||||||
6. True or false: The Linux kernel includes drivers for various disk controllers, network adapters, and USB interfaces, among other things.
|
6. True or false: The Linux kernel includes drivers for various disk controllers, network adapters, and USB interfaces, among other things.
|
||||||
|
@ -180,23 +180,23 @@
|
||||||
## Review Questions
|
## Review Questions
|
||||||
|
|
||||||
1. What keystroke moves the cursor to the start of the line when typing a command in Bash?
|
1. What keystroke moves the cursor to the start of the line when typing a command in Bash?
|
||||||
* Ctrl+A
|
* A) Ctrl+A
|
||||||
* Left arrow
|
* B) Left arrow
|
||||||
* Ctrl+T
|
* C) Ctrl+T
|
||||||
* Up arrow
|
* D) Up arrow
|
||||||
* Ctrl+E
|
* E) Ctrl+E
|
||||||
2. How can you run a program in the background when launching it from a shell? (Select all that apply.)
|
2. How can you run a program in the background when launching it from a shell? (Select all that apply.)
|
||||||
* Launch the program by typing `start command`, where `command` is the command you want to run.
|
* A) Launch the program by typing `start command`, where `command` is the command you want to run.
|
||||||
* Launch the program by typing `bg command`, where `command` is the command you want to run.
|
* B) Launch the program by typing `bg command`, where `command` is the command you want to run.
|
||||||
* Append an ampersand `&` to the end of the command line.
|
* C) Append an ampersand `&` to the end of the command line.
|
||||||
* Launch the program normally, type Ctrl+Z in the shell, and then type `bg` in the shell.
|
* D) Launch the program normally, type Ctrl+Z in the shell, and then type `bg` in the shell.
|
||||||
* Launch the program normally, type Ctrl+Z in the shell, and then type `fg` in the shell.
|
* E) Launch the program normally, type Ctrl+Z in the shell, and then type `fg` in the shell.
|
||||||
3. Which of the following commands, typed at a Bash prompt, returns you to your home directory?
|
3. Which of the following commands, typed at a Bash prompt, returns you to your home directory?
|
||||||
* `home`
|
* A) `home`
|
||||||
* `cd /home`
|
* B) `cd /home`
|
||||||
* `cd homedir`
|
* C) `cd homedir`
|
||||||
* `homedir`
|
* D) `homedir`
|
||||||
* `cd ~`
|
* E) `cd ~`
|
||||||
4. True or false: The Alt+F2 keystroke, typed in X, brings up a text-mode display you can use to log into Linux.
|
4. True or false: The Alt+F2 keystroke, typed in X, brings up a text-mode display you can use to log into Linux.
|
||||||
5. True or false: The filename `..\\upone.txt` refers to the file `upone.txt` in the parent of the current directory.
|
5. True or false: The filename `..\\upone.txt` refers to the file `upone.txt` in the parent of the current directory.
|
||||||
6. True or false: The `-r` option to `ls` creates a recursive directory listing.
|
6. True or false: The `-r` option to `ls` creates a recursive directory listing.
|
||||||
|
@ -214,12 +214,13 @@
|
||||||
## Review Questions
|
## Review Questions
|
||||||
|
|
||||||
1. Which of the following commands would you type to rename `newfile.txt` to `file.txt`?
|
1. Which of the following commands would you type to rename `newfile.txt` to `file.txt`?
|
||||||
* `mv newfile.txt afile.txt`
|
* A) `mv newfile.txt afile.txt`
|
||||||
* `cp newfile.txt afile.txt`
|
* B) `cp newfile.txt afile.txt`
|
||||||
* `ln newfile.txt afile.txt`
|
* C) `ln newfile.txt afile.txt`
|
||||||
* `rn newfile.txt afile.txt`
|
* D) `rn newfile.txt afile.txt`
|
||||||
* `touch newfile.txt afile.txt`
|
* E) `touch newfile.txt afile.txt`
|
||||||
2. You want to copy a directory, `MyFiles`, to a USB flash drive that uses the FAT filesystem. The contents of `MyFiles` are as follows:
|
2. You want to copy a directory, `MyFiles`, to a USB flash drive that uses the FAT filesystem. The contents of `MyFiles` are as follows:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ ls -l MyFiles/
|
$ ls -l MyFiles/
|
||||||
total 276
|
total 276
|
||||||
|
@ -227,18 +228,19 @@ total 276
|
||||||
-rw-r--r-- 1 rod users 42667 Nov 8 15:12 outline.pdf
|
-rw-r--r-- 1 rod users 42667 Nov 8 15:12 outline.pdf
|
||||||
-rw-r--r-- 1 sam users 105979 Nov 8 15:12 Outline.PDF
|
-rw-r--r-- 1 sam users 105979 Nov 8 15:12 Outline.PDF
|
||||||
```
|
```
|
||||||
|
|
||||||
The USB flash drive is mounted at `/media/usb`, and so you type `cp -a MyFiles /media/`. What problem will occur when you attempt to copy these files?
|
The USB flash drive is mounted at `/media/usb`, and so you type `cp -a MyFiles /media/`. What problem will occur when you attempt to copy these files?
|
||||||
* The command will fail because it tries to create links.
|
* A) The command will fail because it tries to create links.
|
||||||
* The `MyFiles` directory will be copied, but none of its files will be copied.
|
* B) The `MyFiles` directory will be copied, but none of its files will be copied.
|
||||||
* One file will be missing on the USB flash drive.
|
* C) One file will be missing on the USB flash drive.
|
||||||
* One file's name will be changed during the copy.
|
* D) One file's name will be changed during the copy.
|
||||||
* Everything will be fine; the command will work correctly.
|
* E) Everything will be fine; the command will work correctly.
|
||||||
3. You type `mkdir one/two/three` and receive an error message that reads, in part, `No such file or directory`. What can you do to overcome this problem? (Select all that apply.)
|
3. You type `mkdir one/two/three` and receive an error message that reads, in part, `No such file or directory`. What can you do to overcome this problem? (Select all that apply.)
|
||||||
* Add the `--parents` parameter to the `mkdir` command.
|
* A) Add the `--parents` parameter to the `mkdir` command.
|
||||||
* Issue three separate `mkdir` commands: `mkdir one`, then `mkdir one/two`, and then `mkdir one/two/three`.
|
* B) Issue three separate `mkdir` commands: `mkdir one`, then `mkdir one/two`, and then `mkdir one/two/three`.
|
||||||
* Type `touch /bin/mkdir` to be sure the `mkdir` program file exists.
|
* C) Type `touch /bin/mkdir` to be sure the `mkdir` program file exists.
|
||||||
* Type `rmdir one` to clear away the interfering base of the desired new directory tree.
|
* D) Type `rmdir one` to clear away the interfering base of the desired new directory tree.
|
||||||
* Type `rm -r one` to clear away the entire interfering directory tree.
|
* E) Type `rm -r one` to clear away the entire interfering directory tree.
|
||||||
4. True or false: You can create a symbolic link from one low-level filesystem to another.
|
4. True or false: You can create a symbolic link from one low-level filesystem to another.
|
||||||
5. True or false: You can easily damage your Linux installation by mistyping an `rm` command when you log into your regular account.
|
5. True or false: You can easily damage your Linux installation by mistyping an `rm` command when you log into your regular account.
|
||||||
6. True or false: You can set a directory's time stamps with the `touch` command.
|
6. True or false: You can set a directory's time stamps with the `touch` command.
|
||||||
|
@ -257,23 +259,23 @@ The USB flash drive is mounted at `/media/usb`, and so you type `cp -a MyFiles /
|
||||||
## Review Questions
|
## Review Questions
|
||||||
|
|
||||||
1. Which of the following commands is an improved version of `more`?
|
1. Which of the following commands is an improved version of `more`?
|
||||||
* `grep`
|
* A) `grep`
|
||||||
* `html`
|
* B) `html`
|
||||||
* `cat`
|
* C) `cat`
|
||||||
* `less`
|
* D) `less`
|
||||||
* `man`
|
* E) `man`
|
||||||
2. Which of the following statements is a fair comparison of `man` pages to HOWTO documents?
|
2. Which of the following statements is a fair comparison of `man` pages to HOWTO documents?
|
||||||
* `man` pages require Internet access to read; HOWTOs do not.
|
* A) `man` pages require Internet access to read; HOWTOs do not.
|
||||||
* `man` pages are a type of printed documentation; HOWTOs are electronic.
|
* B) `man` pages are a type of printed documentation; HOWTOs are electronic.
|
||||||
* `man` pages describe software from a user's point of view; HOWTOs are programmers' documents.
|
* C) `man` pages describe software from a user's point of view; HOWTOs are programmers' documents.
|
||||||
* `man` pages are brief reference documents; HOWTOs are more tutorial in nature.
|
* D) `man` pages are brief reference documents; HOWTOs are more tutorial in nature.
|
||||||
* `man` pages use a hyperlinked format, whereas HOWTOs do not.
|
* E) `man` pages use a hyperlinked format, whereas HOWTOs do not.
|
||||||
3. A user types `whatis less`. What type of output can be expected?
|
3. A user types `whatis less`. What type of output can be expected?
|
||||||
* A short one-paragraph description of the purpose of the `less` command
|
* A) A short one-paragraph description of the purpose of the `less` command
|
||||||
* The complete path to the `less` command in the Linux filesystem
|
* B) The complete path to the `less` command in the Linux filesystem
|
||||||
* Summary information from `man` pages whose Name sections mention `less`
|
* C) Summary information from `man` pages whose Name sections mention `less`
|
||||||
* The complete `man` page for `less`, which you would then scroll through with your terminal
|
* D) The complete `man` page for `less`, which you would then scroll through with your terminal
|
||||||
* The URLs for Web sites with information on the `less` command
|
* E) The URLs for Web sites with information on the `less` command
|
||||||
4. True or false: You can force `man` to display a `man` page in a specific section of the manual by preceding the search name with the section number, as in `man 5 passwd`.
|
4. True or false: You can force `man` to display a `man` page in a specific section of the manual by preceding the search name with the section number, as in `man 5 passwd`.
|
||||||
5. True or false: `info` pages are a Web-based documentation format.
|
5. True or false: `info` pages are a Web-based documentation format.
|
||||||
6. True or false: Linux documentation in the `/usr/share/doc` directory tree is almost always in OpenDocument Text format.
|
6. True or false: Linux documentation in the `/usr/share/doc` directory tree is almost always in OpenDocument Text format.
|
||||||
|
@ -291,23 +293,23 @@ The USB flash drive is mounted at `/media/usb`, and so you type `cp -a MyFiles /
|
||||||
## Review Questions
|
## Review Questions
|
||||||
|
|
||||||
1. Which of the following tools is best suited to installing a software package and all its dependencies on a Debian computer?
|
1. Which of the following tools is best suited to installing a software package and all its dependencies on a Debian computer?
|
||||||
* `yum`
|
* A) `yum`
|
||||||
* `zypper`
|
* B) `zypper`
|
||||||
* `dmesg`
|
* C) `dmesg`
|
||||||
* `rpm`
|
* D) `rpm`
|
||||||
* `apt-get`
|
* E) `apt-get`
|
||||||
2. What is the usual name of the first process that the Linux kernel runs, aside from itself?
|
2. What is the usual name of the first process that the Linux kernel runs, aside from itself?
|
||||||
* `init`
|
* A) `init`
|
||||||
* `bash`
|
* B) `bash`
|
||||||
* `cron`
|
* C) `cron`
|
||||||
* `login`
|
* D) `login`
|
||||||
* `grub`
|
* E) `grub`
|
||||||
3. Where do most log files reside on a Linux computer?
|
3. Where do most log files reside on a Linux computer?
|
||||||
* `/var/log`
|
* A) `/var/log`
|
||||||
* `/etc/logging`
|
* B) `/etc/logging`
|
||||||
* `/usr/log`
|
* C) `/usr/log`
|
||||||
* `/home/logging`
|
* D) `/home/logging`
|
||||||
* `/log/usr`
|
* E) `/log/usr`
|
||||||
4. True or false: When using suitable commands, you can normally install a program and be sure that all the software on which it depends will also be installed, provided you have an Internet connection.
|
4. True or false: When using suitable commands, you can normally install a program and be sure that all the software on which it depends will also be installed, provided you have an Internet connection.
|
||||||
5. True or false: By default, the first process listed in `top` is currently consuming the most CPU time.
|
5. True or false: By default, the first process listed in `top` is currently consuming the most CPU time.
|
||||||
6. True or false: The `dmesg` command may produce different output after a computer has been running for weeks than when it first started.
|
6. True or false: The `dmesg` command may produce different output after a computer has been running for weeks than when it first started.
|
||||||
|
@ -327,23 +329,23 @@ The USB flash drive is mounted at `/media/usb`, and so you type `cp -a MyFiles /
|
||||||
## Review Questions
|
## Review Questions
|
||||||
|
|
||||||
1. Which of the following commands will print lines from the file `world.txt` that contain matches to `changes`and `changed`?
|
1. Which of the following commands will print lines from the file `world.txt` that contain matches to `changes`and `changed`?
|
||||||
* `grep change[ds] world.txt`
|
* A) `grep change[ds] world.txt`
|
||||||
* `tar change[d-s] world.txt`
|
* B) `tar change[d-s] world.txt`
|
||||||
* `find "[change\'d\|s]\'" world.txt`
|
* C) `find "[change\'d\|s]\'" world.txt`
|
||||||
* `cat world.txt changes changed`
|
* D) `cat world.txt changes changed`
|
||||||
* `find change[\^ds] world.txt`
|
* E) `find change[\^ds] world.txt`
|
||||||
2. Which of the following redirection operators appends a program's standard output to an existing file, without overwriting that file's original contents?
|
2. Which of the following redirection operators appends a program's standard output to an existing file, without overwriting that file's original contents?
|
||||||
* `|`
|
* A) `|`
|
||||||
* `2>`
|
* B) `2>`
|
||||||
* `&>`
|
* C) `&>`
|
||||||
* `>`
|
* D) `>`
|
||||||
* `>>`
|
* E) `>>`
|
||||||
3. You've received a tarball called `data79.tar` from a colleague, but you want to check the names of the files it contains before extracting them. Which of the following commands would you use to do this?
|
3. You've received a tarball called `data79.tar` from a colleague, but you want to check the names of the files it contains before extracting them. Which of the following commands would you use to do this?
|
||||||
* `tar uvf data79.tar`
|
* A) `tar uvf data79.tar`
|
||||||
* `tar cvf data79.tar`
|
* B) `tar cvf data79.tar`
|
||||||
* `tar xvf data79.tar`
|
* C) `tar xvf data79.tar`
|
||||||
* `tar tvf data79.tar`
|
* D) `tar tvf data79.tar`
|
||||||
* `tar Avf data79.tar`
|
* E) `tar Avf data79.tar`
|
||||||
4. True or false: The regular expression `Linu[^x].*lds` matches the string `Linus Torvalds`.
|
4. True or false: The regular expression `Linu[^x].*lds` matches the string `Linus Torvalds`.
|
||||||
5. True or false: The `find` command enables you to locate files based on their sizes.
|
5. True or false: The `find` command enables you to locate files based on their sizes.
|
||||||
6. True or false: To compress files archived with `zip`, you must use an external compression program such as `gzip` or `bzip2` in a pipeline with `zip`.
|
6. True or false: To compress files archived with `zip`, you must use an external compression program such as `gzip` or `bzip2` in a pipeline with `zip`.
|
||||||
|
@ -363,23 +365,23 @@ The USB flash drive is mounted at `/media/usb`, and so you type `cp -a MyFiles /
|
||||||
## Review Questions
|
## Review Questions
|
||||||
|
|
||||||
1. Which type of file is `nano` *least* likely to be useful for examining or editing?
|
1. Which type of file is `nano` *least* likely to be useful for examining or editing?
|
||||||
* A `/var/log/messages` log file
|
* A) A `/var/log/messages` log file
|
||||||
* An HTML Web page file
|
* B) An HTML Web page file
|
||||||
* An e-mail message saved from an e-mail client
|
* C) An e-mail message saved from an e-mail client
|
||||||
* A LibreOffice word processing document
|
* D) A LibreOffice word processing document
|
||||||
* An `/etc/X11/xorg.conf` configuration file
|
* E) An `/etc/X11/xorg.conf` configuration file
|
||||||
2. Which keystrokes invoke the `pico` or `nano` search function? (Select all that apply.)
|
2. Which keystrokes invoke the `pico` or `nano` search function? (Select all that apply.)
|
||||||
* F3
|
* A) F3
|
||||||
* F6
|
* B) F6
|
||||||
* Esc-S
|
* C) Esc-S
|
||||||
* Ctrl+F
|
* D) Ctrl+F
|
||||||
* Ctrl+W
|
* E) Ctrl+W
|
||||||
3. How would you remove two lines of text from a file using Vi?
|
3. How would you remove two lines of text from a file using Vi?
|
||||||
* In command mode, position the cursor on the first line and type `2dd`.
|
* A) In command mode, position the cursor on the first line and type `2dd`.
|
||||||
* In command mode, position the cursor on the last line and type `2yy`.
|
* B) In command mode, position the cursor on the last line and type `2yy`.
|
||||||
* In insert mode, position the cursor at the start of the first line, hold down the Shift key while pressing the Down arrow key twice, and press the Delete key on the keyboard.
|
* C) In insert mode, position the cursor at the start of the first line, hold down the Shift key while pressing the Down arrow key twice, and press the Delete key on the keyboard.
|
||||||
* In insert mode, position the cursor at the start of the first line and press Ctrl+K twice.
|
* D) In insert mode, position the cursor at the start of the first line and press Ctrl+K twice.
|
||||||
* Select the text with the mouse and then select File ⇒ Delete from the menu.
|
* E) Select the text with the mouse and then select File ⇒ Delete from the menu.
|
||||||
4. True or false: Unicode is useful for encoding most European languages but not Asian languages.
|
4. True or false: Unicode is useful for encoding most European languages but not Asian languages.
|
||||||
5. True or false: GUI text editors for ASCII are superior to text-mode ASCII text editors because the GUI editors support underlining, italics, and multiple fonts.
|
5. True or false: GUI text editors for ASCII are superior to text-mode ASCII text editors because the GUI editors support underlining, italics, and multiple fonts.
|
||||||
6. True or false: Many (but not all) configuration files use a hash mark `#` to identify comment lines.
|
6. True or false: Many (but not all) configuration files use a hash mark `#` to identify comment lines.
|
||||||
|
@ -401,36 +403,40 @@ The USB flash drive is mounted at `/media/usb`, and so you type `cp -a MyFiles /
|
||||||
## Review Questions
|
## Review Questions
|
||||||
|
|
||||||
1. After using a text editor to create a shell script, what step should you take before trying to use the script by typing its name?
|
1. After using a text editor to create a shell script, what step should you take before trying to use the script by typing its name?
|
||||||
* Set one or more executable bits using `chmod`.
|
* A) Set one or more executable bits using `chmod`.
|
||||||
* Copy the script to the `/usr/bin/scripts` directory.
|
* B) Copy the script to the `/usr/bin/scripts` directory.
|
||||||
* Compile the script by typing `bash scriptname`, where `scriptname` is the script's name.
|
* C) Compile the script by typing `bash scriptname`, where `scriptname` is the script's name.
|
||||||
* Run a virus checker on the script to be sure it contains no viruses.
|
* D) Run a virus checker on the script to be sure it contains no viruses.
|
||||||
* Run a spell checker on the script to ensure it contains no bugs.
|
* E) Run a spell checker on the script to ensure it contains no bugs.
|
||||||
2. Describe the effect of the following short script, `cp1`, if it's called as `cp1 big.c big.cc`:
|
2. Describe the effect of the following short script, `cp1`, if it's called as `cp1 big.c big.cc`:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
cp $2 $1
|
cp $2 $1
|
||||||
```
|
```
|
||||||
* It has the same effect as the `cp` command, copying the contents of `big.c` to `big.cc`.
|
|
||||||
* It compiles the C program `big.c` and calls the result `big.cc`.
|
* A) It has the same effect as the `cp` command, copying the contents of `big.c` to `big.cc`.
|
||||||
* It copies the contents of `big.cc` to `big.c`, eliminating the old `big.c`.
|
* B) It compiles the C program `big.c` and calls the result `big.cc`.
|
||||||
* It converts the C program `big.c` into a C++ program called `big.cc`.
|
* C) It copies the contents of `big.cc` to `big.c`, eliminating the old `big.c`.
|
||||||
* The script's first line is invalid, so it won't work.
|
* D) It converts the C program `big.c` into a C++ program called `big.cc`.
|
||||||
|
* E) The script's first line is invalid, so it won't work.
|
||||||
3. What is the purpose of conditional expressions in shell scripts?
|
3. What is the purpose of conditional expressions in shell scripts?
|
||||||
* They prevent scripts from executing if license conditions aren't met.
|
* A) They prevent scripts from executing if license conditions aren't met.
|
||||||
* They display information about the script's computer environment.
|
* B) They display information about the script's computer environment.
|
||||||
* They enable the script to take different actions in response to variable data.
|
* C) They enable the script to take different actions in response to variable data.
|
||||||
* They enable scripts to learn in a manner reminiscent of Pavlovian conditioning.
|
* D) They enable scripts to learn in a manner reminiscent of Pavlovian conditioning.
|
||||||
* They cause scripts to run only at specified times of day.
|
* E) They cause scripts to run only at specified times of day.
|
||||||
4. True or false: A user types `myscript laser.txt` to run a script called `myscript`. Within `myscript`, the `$0` variable holds the value `laser.txt`.
|
4. True or false: A user types `myscript laser.txt` to run a script called `myscript`. Within `myscript`, the `$0` variable holds the value `laser.txt`.
|
||||||
5. True or false: Valid looping statements in Bash include `for`, `while`, and `until`.
|
5. True or false: Valid looping statements in Bash include `for`, `while`, and `until`.
|
||||||
6. True or false: The following script launches three simultaneous instances of the `terminal` program.
|
6. True or false: The following script launches three simultaneous instances of the `terminal` program.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
terminal
|
terminal
|
||||||
terminal
|
terminal
|
||||||
terminal
|
terminal
|
||||||
```
|
```
|
||||||
|
|
||||||
7. You've written a simple shell script that does nothing but launch programs. In order to ensure that the script works with most user shells, what should its first line read?
|
7. You've written a simple shell script that does nothing but launch programs. In order to ensure that the script works with most user shells, what should its first line read?
|
||||||
8. What command can you use to display prompts for a user in a shell script?
|
8. What command can you use to display prompts for a user in a shell script?
|
||||||
9. What Bash scripting command can you use to control the program flow based on a variable that can take many values (such as all the letters of the alphabet)?
|
9. What Bash scripting command can you use to control the program flow based on a variable that can take many values (such as all the letters of the alphabet)?
|
||||||
|
@ -447,23 +453,23 @@ terminal
|
||||||
## Review Questions
|
## Review Questions
|
||||||
|
|
||||||
1. What is the purpose of the system account with a UID of 0?
|
1. What is the purpose of the system account with a UID of 0?
|
||||||
* It's the system administration account.
|
* A) It's the system administration account.
|
||||||
* It's the account for the first ordinary user.
|
* B) It's the account for the first ordinary user.
|
||||||
* Nothing; UID 0 is left intentionally undefined.
|
* C) Nothing; UID 0 is left intentionally undefined.
|
||||||
* It varies from one distribution to another.
|
* D) It varies from one distribution to another.
|
||||||
* It's a low-privilege account that's used as a default by some servers.
|
* E) It's a low-privilege account that's used as a default by some servers.
|
||||||
2. What type of information will you find in `/etc/passwd` for ordinary user accounts? (Select all that apply.)
|
2. What type of information will you find in `/etc/passwd` for ordinary user accounts? (Select all that apply.)
|
||||||
* A user ID (UID) number
|
* A) A user ID (UID) number
|
||||||
* A complete listing of every group to which the user belongs
|
* B) A complete listing of every group to which the user belongs
|
||||||
* The path to the account's home directory
|
* C) The path to the account's home directory
|
||||||
* The path to the account's default GUI desktop environment
|
* D) The path to the account's default GUI desktop environment
|
||||||
* The path to the account's default text-mode shell
|
* E) The path to the account's default text-mode shell
|
||||||
3. You want to run the command `iptables -L` as `root` but you're logged in as an ordinary user. Which of the following commands will do the job, assuming the system is configured to give you `root` access via the appropriate command?
|
3. You want to run the command `iptables -L` as `root` but you're logged in as an ordinary user. Which of the following commands will do the job, assuming the system is configured to give you `root` access via the appropriate command?
|
||||||
* `sudo iptables -L`
|
* A) `sudo iptables -L`
|
||||||
* `root iptables -L`
|
* B) `root iptables -L`
|
||||||
* `passwd iptables -L`
|
* C) `passwd iptables -L`
|
||||||
* `su iptables -L`
|
* D) `su iptables -L`
|
||||||
* `admin iptables -L`
|
* E) `admin iptables -L`
|
||||||
4. True or false: `whoami` provides more information than `id`.
|
4. True or false: `whoami` provides more information than `id`.
|
||||||
5. True or false: Linux stores information on its groups in the `/etc/groups` file.
|
5. True or false: Linux stores information on its groups in the `/etc/groups` file.
|
||||||
6. True or false: As a general rule, you should employ extra care when running programs as `root`.
|
6. True or false: As a general rule, you should employ extra care when running programs as `root`.
|
||||||
|
@ -483,23 +489,23 @@ terminal
|
||||||
## Review Questions
|
## Review Questions
|
||||||
|
|
||||||
1. What would a Linux system administrator type to remove the `nemo` account and its home directory
|
1. What would a Linux system administrator type to remove the `nemo` account and its home directory
|
||||||
* `userdel nemo`
|
* A) `userdel nemo`
|
||||||
* `userdel -f nemo`
|
* B) `userdel -f nemo`
|
||||||
* `userdel -r nemo`
|
* C) `userdel -r nemo`
|
||||||
* `rm /home/nemo`
|
* D) `rm /home/nemo`
|
||||||
* `rm -r /home/nemo`
|
* E) `rm -r /home/nemo`
|
||||||
2. Of the following, which is the *best* password?
|
2. Of the following, which is the *best* password?
|
||||||
* `LinusTorvalds`
|
* A) `LinusTorvalds`
|
||||||
* `uB2op%4q****************`
|
* B) `uB2op%4q****************`
|
||||||
* `123456`
|
* C) `123456`
|
||||||
* `password`
|
* D) `password`
|
||||||
* `peanutbuttersandwich`
|
* E) `peanutbuttersandwich`
|
||||||
3. Describe the effect of the following command, assuming it completes successfully: `groupadd henry`
|
3. Describe the effect of the following command, assuming it completes successfully: `groupadd henry`
|
||||||
* It creates a new group called `henry`.
|
* A) It creates a new group called `henry`.
|
||||||
* It adds the user `henry` to the current default group.
|
* B) It adds the user `henry` to the current default group.
|
||||||
* It imports group information from the file called `henry`.
|
* C) It imports group information from the file called `henry`.
|
||||||
* It changes the user's default group to `henry`.
|
* D) It changes the user's default group to `henry`.
|
||||||
* It adds the group `henry` to the user's list of groups.
|
* E) It adds the group `henry` to the user's list of groups.
|
||||||
4. True or false: User accounts have higher UID numbers than do system accounts.
|
4. True or false: User accounts have higher UID numbers than do system accounts.
|
||||||
5. True or false: Command-line users should normally use `usermod` to change their passwords.
|
5. True or false: Command-line users should normally use `usermod` to change their passwords.
|
||||||
6. True or false: After deleting an account, files formerly owned by the deleted account may remain on the computer.
|
6. True or false: After deleting an account, files formerly owned by the deleted account may remain on the computer.
|
||||||
|
@ -520,23 +526,23 @@ terminal
|
||||||
## Review Questions
|
## Review Questions
|
||||||
|
|
||||||
1. What command would you type (as `root`) to change the ownership of `somefile.txt` from `ralph` to `tony`?
|
1. What command would you type (as `root`) to change the ownership of `somefile.txt` from `ralph` to `tony`?
|
||||||
* `chown ralph:tony somefile.txt`
|
* A) `chown ralph:tony somefile.txt`
|
||||||
* `chmod somefile.txt tony`
|
* B) `chmod somefile.txt tony`
|
||||||
* `chown somefile.txt tony`
|
* C) `chown somefile.txt tony`
|
||||||
* `chown tony somefile.txt`
|
* D) `chown tony somefile.txt`
|
||||||
* `chmod tony somefile.txt`
|
* E) `chmod tony somefile.txt`
|
||||||
2. Typing `ls -ld wonderjaye` reveals a symbolic file mode of `drwxr-xr-x`. Which of the following are true? (Select all that apply.)
|
2. Typing `ls -ld wonderjaye` reveals a symbolic file mode of `drwxr-xr-x`. Which of the following are true? (Select all that apply.)
|
||||||
* `wonderjaye` is a symbolic link.
|
* A) `wonderjaye` is a symbolic link.
|
||||||
* `wonderjaye` is an executable program.
|
* B) `wonderjaye` is an executable program.
|
||||||
* `wonderjaye` is a directory.
|
* C) `wonderjaye` is a directory.
|
||||||
* `wonderjaye` may be read by all users of the system.
|
* D) `wonderjaye` may be read by all users of the system.
|
||||||
* `wonderjaye` may be written by any member of the file's group.
|
* E) `wonderjaye` may be written by any member of the file's group.
|
||||||
3. Which of the following commands can you use to change a file's group?
|
3. Which of the following commands can you use to change a file's group?
|
||||||
* `groupmod`
|
* A) `groupmod`
|
||||||
* `chmod`
|
* B) `chmod`
|
||||||
* `ls`
|
* C) `ls`
|
||||||
* `chown`
|
* D) `chown`
|
||||||
4. True or false: A file with permissions of 755 can be read by any user on the computer, assuming all users can read the directory in which it resides.
|
4. TruE) e or false: A file with permissions of 755 can be read by any user on the computer, assuming all users can read the directory in which it resides.
|
||||||
5. True or false: Only `root` may use the `chmod` command.
|
5. True or false: Only `root` may use the `chmod` command.
|
||||||
6. True or false: Only `root` may change a file's ownership with `chown`.
|
6. True or false: Only `root` may change a file's ownership with `chown`.
|
||||||
7. What option causes `chown` to change ownership on an entire directory tree?
|
7. What option causes `chown` to change ownership on an entire directory tree?
|
||||||
|
@ -555,23 +561,23 @@ terminal
|
||||||
## Review Questions
|
## Review Questions
|
||||||
|
|
||||||
1. What types of files are you likely to find in `/usr/lib`, according to the FHS?
|
1. What types of files are you likely to find in `/usr/lib`, according to the FHS?
|
||||||
* Liberty files
|
* A) Liberty files
|
||||||
* Liberated files
|
* B) Liberated files
|
||||||
* Libra files
|
* C) Libra files
|
||||||
* Library files
|
* D) Library files
|
||||||
* Liberal files
|
* E) Liberal files
|
||||||
2. You want to discover the sizes of several dot files in a directory. Which of the following commands might you use to do this?
|
2. You want to discover the sizes of several dot files in a directory. Which of the following commands might you use to do this?
|
||||||
* `ls -la`
|
* A) `ls -la`
|
||||||
* `ls -p`
|
* B) `ls -p`
|
||||||
* `ls -R`
|
* C) `ls -R`
|
||||||
* `ls -d`
|
* D) `ls -d`
|
||||||
* `ls -ld`
|
* E) `ls -ld`
|
||||||
3. When should programs be configured SUID `root`?
|
3. When should programs be configured SUID `root`?
|
||||||
* At all times; this permission is required for executable programs.
|
* A) At all times; this permission is required for executable programs.
|
||||||
* Whenever a program should be able to access a device file.
|
* B) Whenever a program should be able to access a device file.
|
||||||
* Only when they require `root` privileges to do their job.
|
* C) Only when they require `root` privileges to do their job.
|
||||||
* Whenever the program must be able to access an account's user ID (UID) number.
|
* D) Whenever the program must be able to access an account's user ID (UID) number.
|
||||||
* Never; this permission is a severe security risk.
|
* E) Never; this permission is a severe security risk.
|
||||||
4. True or false: Print spool files are stored in a subdirectory of `/var`.
|
4. True or false: Print spool files are stored in a subdirectory of `/var`.
|
||||||
5. True or false: On a properly configured Linux system, any user can delete any file from `/tmp`.
|
5. True or false: On a properly configured Linux system, any user can delete any file from `/tmp`.
|
||||||
6. True or false: If you hide a file in Linux by making it a dot file, you must change any existing references to that file in configuration files if those references are to continue working.
|
6. True or false: If you hide a file in Linux by making it a dot file, you must change any existing references to that file in configuration files if those references are to continue working.
|
||||||
|
@ -592,23 +598,23 @@ terminal
|
||||||
## Review Questions
|
## Review Questions
|
||||||
|
|
||||||
1. You want to set up a computer on a local network via a static TCP/IP configuration, but you lack a gateway address. Which of the following is true?
|
1. You want to set up a computer on a local network via a static TCP/IP configuration, but you lack a gateway address. Which of the following is true?
|
||||||
* Because the gateway address is necessary, no TCP/IP networking functions will work.
|
* A) Because the gateway address is necessary, no TCP/IP networking functions will work.
|
||||||
* TCP/IP networking will function, but you'll be unable to convert hostnames to IP addresses, and vice versa.
|
* B) TCP/IP networking will function, but you'll be unable to convert hostnames to IP addresses, and vice versa.
|
||||||
* You'll be able to communicate with machines on your local network segment but not with other systems.
|
* C) You'll be able to communicate with machines on your local network segment but not with other systems.
|
||||||
* The computer won't be able to tell which other computers are local and which are remote.
|
* D) The computer won't be able to tell which other computers are local and which are remote.
|
||||||
* You'll be able to use the computer as a network server system, but not as a network client.
|
* E) You'll be able to use the computer as a network server system, but not as a network client.
|
||||||
2. Which of the following types of information are returned by typing `ifconfig eth0`? (Select all that apply.)
|
2. Which of the following types of information are returned by typing `ifconfig eth0`? (Select all that apply.)
|
||||||
* The names of programs that are using `eth0`
|
* A) The names of programs that are using `eth0`
|
||||||
* The IP address assigned to `eth0`
|
* B) The IP address assigned to `eth0`
|
||||||
* The hardware address of `eth0`
|
* C) The hardware address of `eth0`
|
||||||
* The hostname associated with `eth0`
|
* D) The hostname associated with `eth0`
|
||||||
* The gateway with which `eth0` communicates
|
* E) The gateway with which `eth0` communicates
|
||||||
3. The `ping` utility responds normally when you use it with an IP address but not when you use it with a hostname that you're positive corresponds to this IP address. What might cause this problem? (Select all that apply.)
|
3. The `ping` utility responds normally when you use it with an IP address but not when you use it with a hostname that you're positive corresponds to this IP address. What might cause this problem? (Select all that apply.)
|
||||||
* The route between your computer and its DNS server may be incorrect.
|
* A) The route between your computer and its DNS server may be incorrect.
|
||||||
* The target computer may be configured to ignore packets from `ping`.
|
* B) The target computer may be configured to ignore packets from `ping`.
|
||||||
* The DNS configuration on the target system may be broken.
|
* C) The DNS configuration on the target system may be broken.
|
||||||
* Your computer's hostname may be set incorrectly.
|
* D) Your computer's hostname may be set incorrectly.
|
||||||
* Your computer's DNS configuration may be broken.
|
* E) Your computer's DNS configuration may be broken.
|
||||||
4. True or false: IPv4 addresses are four bytes in length.
|
4. True or false: IPv4 addresses are four bytes in length.
|
||||||
5. True or false: The `/etc/resolv.conf` file tells the computer whether to use DHCP for its network configuration.
|
5. True or false: The `/etc/resolv.conf` file tells the computer whether to use DHCP for its network configuration.
|
||||||
6. True or false: You can check the current status of your routing table by typing `route` at a shell prompt.
|
6. True or false: You can check the current status of your routing table by typing `route` at a shell prompt.
|
||||||
|
|
Loading…
Reference in New Issue