Linux operation and maintenance engineers interview small ape laps (containing answers)

1, one day misuse, performed rm -rf *, what would happen? Please give examples.

- If the current directory is "/ tmp", then something in this directory will delete all (by default does not contain hidden files)

- If the current directory is "/", then the data on the system will be lost, and can not be started, the system crashes (this command with caution)

2. What is CDN?

- the content delivery network

- Its purpose is to add a new layer of network architecture in the existing Internet, the content of the site to publish

Network edge closest to the user, the user can go to obtain the desired content, improve user access to the site speed

3, statistics ip access cases, requirements analysis nginx access log to find out the number of pages accessed the previous ten ip

- cat access.log | awk '{print $1}' | uniq -c | sort -rn | head -10

4, how to forward the request to the local port 80 to port 8080, the current host IP is 192.168.2.1

- iptables -A PREROUTING -d 192.168.2.1 -p tcp -m tcp -dport 80 -j DNAT-to-destination 192.168.2.1:8080

5, real-time captured and displayed as the current system tcp 80 port network data information, please write the full operation command?

- tcpdump -nn tcp port 80

6, talk about the TCP / IP-seven-layer model?

- application layer (Application):

An interface network services and end users.

协议有:HTTP FTP TFTP SMTP SNMP DNS TELNET HTTPS POP3 DHCP

- Presentation Layer (Presentation Layer):

Representing data, security, compression. (Five in the model which has been incorporated into the application layer)

Format, JPEG, ASCll, DECOIC, encrypted format

- Session layer (Session Layer):

Establishing, managing, terminating the session. (Five in the model which has been incorporated into the application layer)

Corresponding to the host process, it means the local host and the remote host ongoing session

- Transport Layer (Transport):

Definition of transmission of data protocol port, and flow control and error checking.

There protocols: TCP UDP, i.e., once the packet leaves the network adapter into the network transport layer

- Network layer (Network):

Address logical address, to achieve routing between different networks.

There protocol: ICMP IGMP IP (IPV4 IPV6) ARP RARP

- data link layer (Link):

Establishing a logical connection, hardware address addressing, error checking and other functions. (Defined by the underlying network protocol)

Further the bits into bytes grouped into frames, the MAC address access media, but can not correct errors found

- the physical layer (Physical Layer):

The computer network is the lowest layer of the OSI model

The physical layer provides that: the physical link transmission data is created by the need to maintain, demolition

Provided with mechanical characteristics, electrical, and functional specifications

It said single physical layer ensures that the original data can be transferred in a variety of physical media. LAN and WAN as both the first and second layers

The physical layer is the first layer of the OSI, while it at the bottom, it is the foundation of the open system

The physical layer provides transmission media interconnects and data communication between devices, to provide reliable data transmission for the environment

7, / mnt directory is mainly used for what? / Root directory with root user have anything to do? / Root directory has any contact with the / boot directory?

- / mnt typically used to mount the external device

- / root is a directory, the root user's home directory

- / boot directory is a subdirectory / directory

8, using a Linux virtual machine installed on the system, suddenly want to clone a server, after cloning found no Internet access, how to solve?

- Edit NIC configuration file / etc / sysconfig / network-scripts / ifcfg-eth0, the MAC address and the two lines HWADDR deleted.

- modify the file /etc/udev/rules.d/70-persistent-net.rules, where before deleting the line eth0, the next line will be revised to eth0 eth1

- reboot

9, a system at the end of the linux find txt, 30 days without modifying the file size is greater than 20K have both file and execute permissions to the backup / data / backup / directory.

- find / -name *txt -mtime +30 -type f  -size +20k -perm a=x -exec cp {} /data/backup/ \

10, there is a removable hard disk, there are 300G data above, how to quickly cp linux server?

- set the hard disk on the server identified as sdbc

- mkdir /mydata

- mount -t ntfs-3g /dev/sdbc  /mydata

(You may need to install ntfs-3g_ntfsprogs)

11, during the month, 6:00 to 12:00 in the morning every day, every two hours to create a test.txt file contents ok, how?

- crontab -e to enter edit mode

- Add the following 0 6-12 / 2 * 4 * / bin / touch test.txt (to April, for example)

- start the service service crontab start; chkconfig crontab on

12, write a script

Create a function that can accept two parameters:

1) The first argument is the URL, you can download files; the second argument is a directory, that is, save the downloaded position;

2) If the user to the directory does not exist, the user is prompted whether to create; if you create will continue, otherwise, the function returns an error of a value to the calling script 51;

3) If the given directory exists, the download file; After running the downloaded file download command to test the success; if successful, 0 is returned to the calling script, otherwise, it returns to the calling script 52;


 

These are the small series finishing 12 operation and maintenance engineers face questions, look for friends who want to quit or operation and maintenance work can do it, if you feel there are difficulties, I suggest in their own small circle ape self-upgrade yourself, then go work, I hope you can quit successfully, to find a satisfactory job ~

Guess you like

Origin www.cnblogs.com/xiaoyuanquan/p/10929919.html