Linux standard textbook chapter end test answer

Chapter 1 What is Linux? (1) Select the appropriate basic software. Windows Linux

(2) Select the appropriate application software. Word Excel

(3) Name two appropriate roles for the Operating System. Providing common parts Resource management

(4) Choose the one that correctly describes Linux. Linux consists of a kernel and a userland.

(5) Explain the advantages of introducing application software using packages. Eliminate the hassle of building source code

Chapter 2 None

Chapter 3 Basic Commands (1) Write a command that refers to a file or directory. ls

(2) Select the command to display the contents of/media/cdrom/in order of the latest update date. ls -lt /media/cdrom/

(3) Write a command to display the current path. pwd

(4) Move the file test in the/home/user folder to the/root/backup folder. Write the command that applies to the blanks below.

mv /home/user/test /root/backup ls /root/backup 4 in total rw-r--r--. 1 root root 19 June 14 11:14 2012 test

(5) A file in the path/etc that contains the character string "resolv" as part of the file name. Write a command to search for. find /etc -name resolv

Chapter 4 Regular Expressions and Pipes

(1) Use the grep command to select a regular expression that can extract lines that start with a or b from the following four. grep -e [1]

(2) Please answer what the result will be if you execute the command "ls/usr/bin | grep -e ^ a .. $". The three-letter directory name and file name starting with a under/usr/bin are displayed.

(3) Describe the files in the path/etc whose file names end with conf using grep and pipes.

ls /etc | grep conf$

(4) Write the command to write the result of executing ls -l to the ls -result file.

ls -l >> ls-result

(5) Use grep to describe a command that narrows down and displays only iptables from the execution result of chkconfig --list. chkconfig --list | grep iptables

Chapter 5 Basic Commands 2

(1) Add appropriate options so that the result of executing the sort command is obtained.

$ sort (-k 3) price Digital Camera 9800 32-inch TV 49800 Blue-ray Recorder 59800

(2) Answer the execution result when the uniq command is executed for the file called uniq-sample.

red blue red blue

(3) Write a command that compares the differences between the contents of file1 and file2.

diff file1 file2

(4) When I executed the following command, no result was displayed and I was in a command waiting state. Answer what you can think of.

The contents of file1 and file2 are the same

(5) Write the command to display the last 8 lines of the file ls-etc where the execution result of the ls command in the path/etc is saved.

$ tail -n 8 ls-etc wpa_supplicant xdg xinetd.d xml yp.conf yum yum.conf yum.repos.d Answer: tail -n 8

Chapter 6 vi editor If you are using vi, answer the command to achieve the following: (1) Copy 3 lines from the current line.

3yy

(2) Search for the word abc in the document.

/abc

(3) Forcibly terminate the file being edited without saving it.

:q!

(4) Move to the 100th line of the document.

100G

(5) Replace "Koya-dofu" in the document with "Kinugoshi tofu". However, it is executed with the g option.

:% s/Koya tofu/Silken tofu/g

Chapter 7 Administrator Jobs (1) I created user with useradd, but I can't log in. Allow you to log in Answer what you need.

Register the password with the passwd command

(2) Answer the command to delete user user2.

userdel user2

(3) Answer the command for creating the group penguin.

groupadd penguin

(4) Answer the command to change the password of the already created user penguin.

passwd penguin

(5) What is the difference between the su command with and without the-option?

-If you do not add the option, log in as root without changing the current directory. If you add the -option, change the current directory to the root home directory and log in.

Chapter 8 User Rights and Access Rights (1) Select the execution result when the following command is executed. umask 022 touch test chgrp nobody test ls -l test

  1. -rw-r--r--. 1 root nobody 18 May 29 18:51 2012 test

(2) Write a command to set the file mode of chownfile to 755.

chmod 755 chownfile

(3) Write a command to set the file mode of chownfile to 644.

chmod 644 chownfile

(4) The file modes set when a umask file is created after setting umask 070 are as follows. Is it?

  1. -rw ---- r--. 1 user user 0 May 29 19:22 2012 umask

(5) The file modes set when a umask file is created after setting umask 022 are as follows. Is it?

  1. -rw-r--r--. 1 user user 0 May 29 19:24 2012 umask

Chapter 9 Shell Script (1) Output the value entered in the variable "LPI" so that the execution result becomes a solution.

$ LPI=linux $ echo $LPI linux Answer: $ LPI

(2) Fill in the blanks in the script below and complete the script to check if the file lpi.txt exists in the current directory.

!/bin/bash

if [ -f lpi.txt ]; then echo file exists. else echo file does not exists. fi Answer: else, fi

(3) Fill in the blanks in the script below and complete the script that displays the types of all files (except subdirectories) in the current directory.

#!/bin/bash

for i in ls do if [ ! -d $i ]; then file $i fi done Answer: done

(4) Write a shell script that does the following:

  1. When executed, you will be prompted to enter your age as age :.
  2. If you enter a value of 20 or more,'you can drink.' Is output. If you enter a value less than 3.20,'you cannot drink.'Is output.

#!/bin/bash

echo -n age:; read age

if [ $age -ge 20 ]; then echo "you can drink." else echo "you cannot drink." fi (5) In bash, answer how to execute (debug) while displaying the contents of the shell script.

Run a shell script with the sh -x command $ sh -x 9-9-4.sh

Chapter 10 Network Configuration and Management (1) From the following, select the correct combination for the ports used by commonly used servers. Sai.

  1. 22:SSH 80:HTTP 443:HTTPS

(2) Explain the operation and usage of the traceroute command.

Behavior: Show gateways through to destination How to use: When there is no normal response from the destination with the ping command, check whether the routing of the transit gateway is correct.

(3) Display the IP address set in the machine with a command.

ip a

(4) Set 8.8.8.8 as the DNS server reference destination of the machine.

/etc/resolv.conf nameserver 8.8.8.8

(5) Set to deny access from 192.168.100.20.

/etc/hosts.deny sshd : 192.168.100.20

Chapter 11 Process Management (1) When I tried the program being created from a shell script, the prompt did not come back. What kind of workaround is there?

Press CTRL + C to send a SIGINT (Interupt Signal). (2) Which of the following is the correct combination of signal number and signal name?

4 SIGNUP:1,SIGINT:2,SIGKILL:9,SIGTERM:15

Chapter 12 File Management (1) Write a command to check the partition of the hard disk of the machine.

#fdisk -l

(2) Explain the swap file system.

Area for temporarily saving data in memory to the hard disk

(3) Give one point that ext3 and ext4 are superior to ext2.

The journaling function is adopted, and the risk of data loss can be avoided in the event of a system failure.

(4) Explain the difference between hard links and symbolic links.

Hard links directly refer to the substance of the data. (Image of creating another name for data) Symbolic links indirectly refer to the substance of the data. (Image of creating a data shortcut)

(5) Write a command to display the usage of the home directory of the logged-in user.

$ du -sh ~


  1. ab ↩︎

Recommended Posts

Linux standard textbook chapter end test answer
[Reading memo] Linux standard textbook (Chapter 7-8)
Linux standard textbook
Linux standard textbook (ver3.0.2) I tried Chapter 1
[Reading memo] Linux standard textbook (Chapter 1 to Chapter 6)
Linux standard textbook memo 1
Linux standard textbook memo 3
Linux standard textbook part 5
Linux standard textbook part 4
Linux standard textbook memo 1 part 2
I read "Linux standard textbook"!
Linux standard textbook memo part 6
[Chapter 8] Econometrics (Yuhikaku) Chapter End Problem, Answer by python
[Chapter 6] Econometrics (Yuhikaku) Chapter End Problem (Demonstration), Answer by python
Learning from the basics Artificial intelligence textbook Chapter 5 Chapter end problems