Common interview questions for Linux job


linuxOperation and maintenance engineers are often asked a variety of questions during the interview. Next, I will sort out the interview questions according to my own experience for your reference.

Common interview questions for Linux job

Take out the document aaa.txt Lines 4 to 7 of

[[email protected] ~]# cat aaa.txt

[[email protected] ~]# sed -n ‘4,7p’ aaa.txt

Find the file ending in txt in the current directory

[[email protected] ~]# ls
1.txt 2.txt 3.pdf aaa.txt anaconda-ks.cfg
[[email protected] ~]# find ./ -name “*.txt”

Find files over 1m in / usr directory

[[email protected] ~]# find /usr -type f -size +10240k

Write a timed task from 5:00 to 8:00

  • 5-8 * /usr/bin/backup

Principle of master slave replication in MySQL

The update events (update, insert, delete) of the main database DB are written to binlog.
The master database creates a binlog dump thread to send the contents of binlog to the slave library.
The slave library starts and initiates a connection to the master library.
After the slave library is started, an I / O thread is created to read the binlog content from the main database and write it to the relay log.
After starting from the library, create a SQL thread to read the contents from the relay log, and then execute_ Master_ Log_ The POS location starts to execute the read update event and writes the update content to the DB of the slave.

VIM has several modes of operation

commandpattern. End of line mode

Brief introduction of DNS resolution process? visit Analysis process of

First look up the local DNS cache, find the local / etc / hosts file, whether there is forced resolution, if not, go to / etc/ resolv.conf Find records in the specified DNS server (networking is required. After finding the resolution records in the DNS server, add a cache in the local DNS to complete a DNS resolution

Explain the two modes of DNS query

recursive query

Recursive query is a query mode of DNS server. In this mode, the DNS server receives the client request and must reply to the client with an accurate query result. If the DNS server does not store query DNS information locally, the server will query other servers and submit the returned query results to the client.

Iterative query

Another query method of DNS server is iterative query. The DNS server will provide the client with other DNS server addresses that can resolve the query request. When the client sends a query request, the DNS server does not directly reply to the query result, but tells the client the address of another DNS server, and the client sends the DNS server address to the client The server submits the request and loops in turn until the result of the query is returned.

Describe forward and reverse proxies

Forward agent

For example, if we visit foreign websites at home, but we can’t access them directly, we can use a forward proxy server to send the request to the proxy server. The proxy server can visit the foreign website. In this way, the agent can get the returned data from the foreign website, and then return it to us, so that we can visit it.

Reverse proxy

The actual operation mode of reverse proxy is that the proxy server receives the connection request on the Internet, then forwards the request to the server on the internal network, and returns the result from the server to the client requesting connection on the Internet. At this time, the client only accesses the proxy server, but does not know how many servers there are.


The above is the arrangement of my interview, I hope to help you.

Recommended Today

PHP 12th week function learning record

sha1() effect sha1()Function to evaluate the value of a stringSHA-1Hash. usage sha1(string,raw) case <?php $str = “Hello”; echo sha1($str); ?> result f7ff9e8b7bb2e09b70935a5d785e0cc5d9d0abf0 sha1_file() effect sha1_file()Function calculation fileSHA-1Hash. usage sha1_file(file,raw) case <?php $filename = “test.txt”; $sha1file = sha1_file($filename); echo $sha1file; ?> result aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d similar_text() effect similar_text()Function to calculate the similarity between two strings. usage similar_text(string1,string2,percent) case […]