Linux interview test questions (accumulation of wrong questions)

Accumulation of wrong exam questions

1. When logging in to Linux, a shell with a unique process ID number will be called. What is this ID (B)
A.NID B.PID C.UID D.CID

2. Which of the following commands is used to define the shell's global variables (D)
A.exportfs B.alias C.exports D.export

3. When running in multi-user mode, how many virtual user terminals can be switched with Ctrl+Alt+F* (B)
A.3 B.6 C.1 D.12

4. Which of the following commands lists a detailed list when creating a tar archive file (A)
A.tar -t B.tar -cv C.tar -cvf D.tar -r

5. The following devices belong to block device files are (D)
A. Keyboard B. Terminal C. Joystick D. Hard disk

6. To modify the user's own password can be used (A)
A.passwd B.passwd -d mytest C.passwd mytest D.passwd -l

7. Which of the following files or directories belong to the configuration file (AB)
A.httpd.conf B.htdocs C.extra D.bin

8. What are the types of virtual hosts in the apache service (ACD)
A. Based on the host name B. Based on the MAC address C. Based on the IP address D. Based on the port number

9. There are many other configuration files in the main configuration file. Just remove the comments on these file locations to make these configuration files take effect. The configuration file (A) is the configuration file for virtual host settings.
A.httpd-vhost.conf B.name-vhost.conf C.user-dir.conf D.Virtual-vhost.cond

10. The statement about user authorization is correct (BD)
A. Use system users to verify B. Use htpasswd command to add authorized users separately C. Account is located in /etc/passwd
D. Use separate account folder to store verification Account

11. In which directory is the data file of the database stored (C)
A./var/local/mysql B./var/local/mysql/var C./usr/local/mysql/data D.usr/local/mysql

12. The statement about backup and recovery of MySQL database is wrong (C)
A. You can use the tar command to package the /usr/local/mysql/var directory to back up the entire database
. B. You can use the mysqldump command to add the -all-databases option to back up the entire database .
The sql script generated after the database C.mysqldump tool is backed up cannot directly view the content. It must be imported into the database to view
D. If the table in the database is backed up, the database name must be specified and the database name must exist when restoring, otherwise Will fail to import

13. In the PHP compilation and installation, in order to successfully install PHP and support some extended functions, what should be done (ABD) (multiple choice)
A. Apache and MySQL must be installed in advance
B. Remove the rpm package installation All PHP-related software packages of, in order to avoid conflicts
. C. The extended function module is not allowed to be installed after PHP is installed, otherwise it will not be supported
. D. The corresponding settings must be added in the Apache configuration file to support

14. The following description of the predefined variables is correct (BC)
A. KaTeX parse error: Expected'EOF', got'#' at position 1: # ̲ indicates the name of the current script B. * indicates the position parameter content
C.$ The return status after the execution of the previous command
D. $0 indicates the content of the positional parameter

15. There are a total of 20 rows of data in the abc.txt file. If you want to view the data between the 11th and 15th rows, the command you should use is (A)
A.tail -15 abc.txt> head -5
B.tail- 15 abc.txt <head -5
C.tail -1 10 abc.txt | head -5
D.tail -15 abc.txt | tail -5

16. What is correct about the nesting description between each statement is (B)
A. If loop statements cannot be nested, case can be nested
B. Any other statement structure can be nested in all statement structures
C.case Statements can be nested if, but case statements cannot be nested in if statements.
D. Statements are similar nesting

17. How to calculate the parameters passed in? (A)
A: KaTeX parse error: Expected'EOF', got'#' at position 1: #̲ B :?
C:$$
D:$*

18.">" What is it for? (B)
A: Redirect input
B: Redirect output
C: Error redirect input
D: Error redirect output

19. How to output the PID of the current shell? (C)
A: echo $?
B: echo $@
C: echo $$
D: echo $%

20.awk'BEGIN {Arr[2,79]=78 __________ }'(ACD)
To make the execution result 78, you should fill in the () statement
A print Arr[“2/03479”]
B print $Arr[2, 79]
C idx=2 SUBSEP 79;print Arr[idx]
D print Arr[ 2, 79]

21. How to run a script in the background? (AB)
A: command &
B: nohup command &
C: source shell-script
D:. Shell-script

22. How to print all the parameters passed to the script? (AD)
A: echo $*
B: echo $0
C: echo $$
D: echo $@

23. How to get the 10th line of the text file?
Method 1:
head -m filename | tail -1 //View the mth line of the filename file (tail -1 is the number 1)
eg head -100 data.txt | tail -1 //View the 100th line of the data.txt file
Method 2:
nl filename | sed -n'mp' //View the mth line of the filename file
eg nl data.txt | sed -n '100p' //View data.txt The 100th line of the file
Method 3:
sed -n'mp' filename //View the mth line of the filename file
eg sed -n '100p' data.txt //View the 100th line of the data.txt file

Guess you like

Origin blog.csdn.net/caodabener/article/details/111144875