Linux several multiple choice questions

1 In Linux crontab * * * * * /usr/local/run.sh What do the 5 * signs represent?

Minute hour day month week

2 After executing chmod ("/usr/test/sample", 0753) under the unix system, the access permission of the file sample is

r: read 4

w: write 2

x: execute 1

 

3 The network address of the LAN is 192.168.1.0/24, and the gateway address of the LAN to connect to other networks is 192.168.1.1. When the host 192.168.1.20 accesses the 172.16.1.0/24 network, the correct route setting is C

route add default 192.168.1.0 netmask 172.168.1.1 metric 1
route add -net 192.168.1.0 gw 192.168.1.1 netmask 255.255.255.0 metric 1
route add -net 172.16.1.0 gw 192.168.1.1 netmask 255.255.255.0 metric 1
route add -net 172.16.1.0 gw 172.16.1.1 netmask 255.255.255.0 metric 1
route add -net (destination subnet) 172.16.1.0 gw (gateway entry gateway) 192.168.1.1 netmask 255.255.255.0 (subnet mask) metric 1 (route hops)

4 Which of the following commands can print the lines containing ERP in the file (demo.log) to standard output (D)

A sed '/ERR/a\' demo.log
B sed '/ERP/p' demo.log
C sed '/ERP/d' demo.log
D sed -n '/ERP/p' demo.log

sed -n'/ERP/p' demo.log -n: only the line specially processed by sed will be printed p: printed

5 Command: [-z””]&&echo 0 ||What is the output of echo 1

[-z STRING] "STRING" is true if the length is zero

"": The length of this variable is 0, so it is true, echo 0 is executed, so 0 is output;

[-z””]&&echo 2 ||echo 1 output as 2;

[-z”s”]&&echo 2 ||echo 1 output as 1;

Guess you like

Origin blog.csdn.net/weixin_40728070/article/details/92799742