First, Linux operation and maintenance exercises and answers
1. Display the lines in the/etc/passwd file that end with bash
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/72/93/wKiom1Xm0FjwCMnCAAB3I_JQ3vU396.jpg "title=" 1.png " alt= "Wkiom1xm0fjwcmncaab3i_jq3vu396.jpg"/>
2. display the two-digit or three-digit number in the/etc/passwd file
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/90/wKioL1Xm0-nAshFBAAI6jr6BBHQ791.jpg "title=" 2.jpg " alt= "Wkiol1xm0-nashfbaai6jr6bbhq791.jpg"/>
3. display lines with ' LISTEN ' followed by 0, one or more whitespace characters in the ' netstat-tan ' command result
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/72/93/wKiom1Xm0-fCz6hDAAB2UKfJyAw850.jpg "title=" 4.jpg " alt= "Wkiom1xm0-fcz6hdaab2ukfjyaw850.jpg"/>
4. Add user bash, Testbash, basher, and Nologin user (Nologin user's shell is/sbin/nologin), then find the same line in the/etc/passwd file as the user name and its shell name
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/90/wKioL1Xm2WHhV-AmAAD4F7VdO64672.jpg "title=" 1.jpg " alt= "Wkiol1xm2whhv-amaad4f7vdo64672.jpg"/>
5. Display the default shell and UID of root, CentOS, or User1 user on the current system (please create these users beforehand, if not present)
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/72/90/wKioL1Xm17bD68D_AABYHnfGVaY784.jpg "title=" 1.jpg " alt= "Wkiol1xm17bd68d_aabyhnfgvay784.jpg"/>
6, find a word in the/etc/rc.d/init.d/functions file (the middle of the word can be underlined) followed by a set of parentheses line
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/93/wKiom1Xm1ffTMvmxAAGb9l8-HYI852.jpg "title=" 1.jpg " alt= "Wkiom1xm1fftmvmxaagb9l8-hyi852.jpg"/>
7, use echo to output a path, and then egrep find its path base name; Further use Egrep to remove its directory name
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/72/93/wKiom1Xm2gzzWboGAABZJYbCBhg431.jpg "title=" 1.jpg " alt= "Wkiom1xm2gzzwbogaabzjybcbhg431.jpg"/>
8. find the number between 1-255 in the result of ifconfig command execution
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/93/wKiom1Xm0mOQHzgDAAGRF52h9jI019.jpg "title=" 3.jpg " alt= "Wkiom1xm0moqhzgdaagrf52h9ji019.jpg"/>
This article is from the "Small Togo" blog, please be sure to keep this source http://icestick8586.blog.51cto.com/9867871/1690907
Linux operations Practice-Regular expressions