Linux Ops Pre-op random exam questions with answers (written Test + on machine)

Source: Internet
Author: User

This article is from the " old boy Linux ops " blog, please be sure to keep this source http://oldboy.blog.51cto.com/2561410/566654

Linux OPS pre-primary course random exam:

First, the written part:

1. What is the file path that the boot configuration service starts from?
Answer:
/etc/rc.local

2. Path to the NIC configuration file
Answer:
/etc/sysconfig/network-scripts/ifcfg-eth0

Path to the 3.Client-side DNS file
Answer:
/etc/resolv.conf
Tip: Server-side DNS default profile path/etc/named.conf

4. How to add a default gateway to the Linux machine using the command line, assuming the gateway address is 10.0.0.254
Answer:
Route add default GW 10.0.0.254

5. Look for a file named services within the server. Give the command.
Answer:
[Email protected] ~]# Find/etc-name Services
/etc/logwatch/conf/services
/etc/services
/etc/avahi/services

6. Known string Oldboy caojunbiao Chenyanfei guoxing Qingyun,linliang
Please remove Oldboy and Linliang two strings by the cut command
Answer:
[Email protected] ~]# echo "Oldboy caojunbiao Chenyanfei guoxing qingyun Linliang" >oldboy.test
[email protected] ~]# cat Oldboy.test
Oldboy Caojunbiao Chenyanfei guoxing Qingyun Linliang
[Email protected] ~]# cut-d ""-f2,6 oldboy.test
Caojunbiao Linliang
Tip: The following command is to fetch 2-6 strings
[Email protected] ~]# cut-d ""-f2-6 oldboy.test
Caojunbiao Chenyanfei guoxing Qingyun Linliang

7. View the Apache service process
Answer:
[Email protected] ~]# Ps-ef|grep httpd|grep-v grep
Root 5130 1 0 Jan12? 00:00:03/application/apache2.2.9/bin/httpd-k start
Daemon 5131 5130 0 Jan12? 00:00:00/application/apache2.2.9/bin/httpd-k start
Daemon 28821 5130 0 May13? 00:00:00/application/apache2.2.9/bin/httpd-k start
Daemon 28944 5130 0 08:58? 00:00:00/application/apache2.2.9/bin/httpd-k start
Daemon 30985 5130 0 11:08? 00:00:00/application/apache2.2.9/bin/httpd-k start

If you are in worker mode:
The
[Email protected] ~]# pstree-a|grep httpd|grep-v grep |wc-l
1526
Hint: There will be a lot, so add wc-l to see the quantity.

8. The known file Oldboy.txt content is
Oldboy
Caojunbiao
Chenyanfei
Guoxing
Qingyun
Linliang
Use the SED command to replace the string containing guoxing in the file with Oldboy.
Answer:
[email protected] ~]# cat Test.txt
Oldboy
Caojunbiao
Chenyanfei
Guoxing
Qingyun
Linliang
[Email protected] ~]# sed-i ' s#guoxing#oldboy# ' test.txt
[email protected] ~]# cat Test.txt
Oldboy
Caojunbiao
Chenyanfei
Oldboy
Qingyun
Linliang
[Email protected] ~]# sed-i ' s#oldboy#qingyun# ' test.txt
[email protected] ~]# cat Test.txt
Qingyun
Caojunbiao
Chenyanfei
Qingyun
Qingyun
Linliang

8. Remove the IP address string from the server eth0 NIC configuration.
For example: The server IP address is 10.0.0.100, then the result is 10.0.0.100
Answer:
[Email protected] ~]# ifconfig eth0|grep 192
inet addr:192.168.1.250 bcast:192.168.1.255 mask:255.255.255.0
[[email protected] ~]# ifconfig eth0|grep 192|cut-c 21-33 =======> This method is not commonly used.
192.168.1.250
[Email protected] ~]# ifconfig eth0|grep 192|sed ' s#^.*addr:## ' |sed ' s#bcast.*$## '
192.168.1.250
[Email protected] ~]# ifconfig eth0|grep 192|sed ' s/^.*addr://g ' | Sed ' s/bcast.*$//g '
192.168.1.250

9. Implementing the packaged/oldboy directory
Answer:
Tar zcvf oldboy.tar.gz/oldboy

10. Implementing the packaged/oldboy directory (excluding the test file in/oldboy)
Tar zcvf oldboy.tar.gz/oldboy--exclude=/oldboy/test
Tip: You can also use the parameter-X

11. Configure a second IP address for the NIC eth0, IP 10.0.0.101
Ifconfig eth0:101 10.0.0.101 netmask 255.255.255.0 up (alias mode add IP)
Tip: Stop command ifconfig eth0:101 down, permanent configuration can also be configured as file name ifcfg-eth0:101 form
Think: Ifdown eth0:101 This command can stop?

This article is from "Beijing old boy Linux Employment Training Center" 2011-5-15
------------> Explanation Right old boy QQ 31333741

Second, the machine part
SSH free landing on-machine combat test questions


Content: Primary class SSH free landing class on the actual combat test:
Duration: 10 minutes

There are three Linux hosts, the machine name is a, B, C, please realize the following requirements:

1. Use the Oldboy user to complete a key multiple lock (a key, B,c lock) of the free landing deployment, as follows:
A---------->b
A---------->c
Note: The implementation of a login b,c do not need to enter password authentication.
Note: This topic is used in production environment, data distribution, release program, batch Management Server and so on.

2. Under the premise of not destroying the 1 deployment, also use Oldboy user to complete multiple keys to a lock (B,c key, a lock)
-Free landing deployment as follows:
B---------->a
C---------->a
Note: This topic is used in the production environment, data backup, etc., but the production environment this way is recommended to be implemented by the daemon process.

The goal of the final realization is, 1, 22 topics to achieve two-way password-free authentication login.

3. If you increase the number of 100 machines in 1, 2, how to continue the rapid deployment of the above 1, 2 free landing program.

Answer: See the lecture.

This article is from "Beijing old boy Linux Employment Training Center" 2011-5-15
------------> Explanation Right old boy QQ 31333741


This article is from "Linux rookie" blog, please be sure to keep this source http://asura1992.blog.51cto.com/8159058/1675610

Linux Ops Pre-op random exam questions with answers (written Test + on machine)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.