Old Boys educate Linux OPS 39 exam questions around the first

Source: Internet
Author: User

1.1does not displayTest.txtThe empty lines in the file and the#the line that begins.

Cat >>/oldboy/test.txt<<eof

123456789

^$

987

#654

^$

321

Eof


method one [[email protected]_39 ~]# egrep-v "#|^$"/oldboy/test.txt

123456789

987

321

Method two [[email protected]_39 ~]# sed-r '/^#|^$/d '/oldboy/test.txt

123456789

987

321

Method three [[Email protected]_39 ~]# awk '!/^#|^$/'/oldboy/test.txt

123456789

987

321



1.2DescriptionLinuxthe startup/There are several operational levels and their meanings.

0 shutdown mode

1 Single-User mode

2 Multi-user mode (no network)

3 Full Multi-user

4 Not used

5 graphical interface

6 restart

RunLevel display the current run level

Init switch Run level

1.3Find/oldboydirectory under All7days ago, toLogend of, and greater than1Mfiles, copy these files to/tmpunder.(not less than3methods)

Method one Find/oldboy-type f-mtime+7-name "*.log"-size +1m|xargs cp-t/tmp

Method two Find/oldboy-type F-mtime+7-name "*.log"-size +1m-exec CP {}/tmp; \

Method three CP $ (find/oldboy-type f-mtime +7-name "*.log"-size +1m)/tmp

1.4How do I see if I turn on22ports, and viewingSshddoes the process exist?

Telnet 10.0.0.200 22

Ps-ef|grep sshd

1.5Please execute the command to removeLinuxinEth0of theIpaddress (at least3methods)

method one [[email protected]_39 ~] #ifconfig eth0|awk-f "[^0-9.] + "' nr==2 {print $} '

10.0.0.200

Method two [[email protected]_39 ~] #ifconfig eth0|sed-n ' 2p ' |sed-r ' S#^.*DR: (. *) Bc.*$#\1#g '

10.0.0.200

Method three [[email protected]_39 ~] #ifconfig eth0|sed-n ' 2p ' |sed ' s#^.*dr:# #g ' |sed ' s#bc.*$# #g '

10.0.0.200

1.6On the basis of the above question, use the command Exchangepasswdin the fileRootLocation and

/bin/bash location? Will all the first and last column locations be swapped?

Example: Default: Root:x:0:0:root:/root:/bin/bash

Modified: /bin/bash:x:0:0:root:/root:root

650) this.width=650; "width=" 1 "height=" 1 "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/themes/default/images/word.gif") no-repeat center;border:1px solid #ddd; "alt=" Spacer.gif "/>650) this.width=650; "width=" 1 "height=" 1 "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/themes/default/images/word.gif") no-repeat center;border:1px solid #ddd; "alt=" Spacer.gif "/>650) this.width=650; "width=" 1 "height=" 1 "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/themes/default/images/word.gif") no-repeat center;border:1px solid #ddd; "alt=" Spacer.gif "/>650) this.width=650; "width=" 1 "height=" 1 "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/themes/default/images/word.gif") no-repeat center;border:1px solid #ddd; "alt=" Spacer.gif "/>650) this.width=650; "width=" 1 "height=" 1 "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/themes/default/images/word.gif") no-repeat center;border:1px solid #ddd; "alt=" Spacer.gif "/>650) this.width=650; "width=" 1 "height=" 1 "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/themes/default/images/word.gif") no-repeat center;border:1px solid #ddd; "alt=" Spacer.gif "/>650) this.width=650; "width=" 1 "height=" 1 "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/themes/default/images/word.gif") no-repeat center;border:1px solid #ddd; "alt=" Spacer.gif "/>650) this.width=650; "width=" 1 "height=" 1 "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/themes/default/images/word.gif") no-repeat center;border:1px solid #ddd; "alt=" Spacer.gif "/>


[email protected]_39 ~]# sed-r ' s# (^[^:]+) (. *:) (. *) #\3\2\1#g '/etc/passwd

1.7please describe in detailLinuxThe process of the system from opening the host power to entering the login interface.

BIOS Post

MBR Boot

GRUB Menu

Load kernel

INIT process (first process)

/etc/inittab (read config file)

/etc/rc.d/rc.sysinit (System init script setting host name IP address)

/ETC/RC.D/RC (different software is launched at boot time depending on the operating level)

Login interface

1.8If you write data to disk, you are prompted with the following error:No space left on device, throughDf-hCheck disk space, found not full, may I ask what is the reason?

The Inode is full.

1.9will be/etc/Directory Packaging compression is placed on/backupdirectories, and require a different file name to be backed up every day, how do I do that?

Tar zcvf/backup/etc-$ (date +%f). tar.gz/etc/

1.10Add a virtual userMysqlSpecifyUidto be888

Useradd-u 888-s/bin/nologin MySQL

1.11Write timed Tasks,every night12Click Delete/var/spool/postfix/maildrop/directory under7days before the file.

Script Name: rmmaildrop.sh script content:/bin/rm $ (find/var/spool/postfix/maildrop/-type f-mtime +7)

Scheduled Tasks: XX * * */bin/sh rmmaildrop.sh>>/dev/null 2>&1

1.12to bealex888User ConfigurationSudopermissions that require you to run all life without having to enter a password

So, how can I configure it?

alex888 all= (All) Nopasswd:all

1.13Add a scheduled task every night12Point, Backup/etc/hosts/etc/servicesfiles to/datadirectory.

Script Name: cpservice.sh script content:/bin/cp/etc/hosts/etc/services/data/$ (date +%f)

Scheduled Tasks: * * * * */bin/sh cpservice.sh>>/dev/null 2>&1

1.14 VimCommon Shortcuts

Quickly reach the last line of the file G

Quickly reach the first line of the file GG

Insert a blank line below the current line and enter edit mode o

Display line number: Set Nu

Delete (cut) the current line DD

Copy Current line yy

Paste P


This article from the "13121275" blog, reproduced please contact the author!

Old Boys educate Linux OPS 39 exam questions around the first

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.