The fourth week of operation (Update ...)
Enterprise
2020-02-14 03:15:59
views: null
The fourth week Homework Solutions
- Statistics of the / etc / passwd file shell non-default number of users / sbin / nologin, and users are displayed;
grep -v '/sbin/nologin' /etc/passwd|egrep -o '^\<[[:alnum:]]+\>'
!?|wc -l
- Identify the user name of the user maximum UID, UID and shell type;
sort -nrk3 -t':' /etc/passwd|head -1|cut -d':' -f1,3,7
- Statistics currently connected connections per remote host IP of the machine, press descending order;
netstat -nt|egrep '\<[0-9]{1,3}\.'|tr -s ' ' ':'|cut -d':' -f4|sort|uniq -c|sort -nr
- Scripting createuser.sh, achieve the following functions: using a user name as a parameter, if the user specifies parameters exists to show its presence, or add it, add the user to display information such as the id;
待解答
- Write basic scripts to generate script formats, including the author, contact information, version, time, and description;
待解答
- What description GPT is how you should use;
待解答
- Create a 10G partition, and format for the ext4 file system. Claim:
- block size of 2048, 20% reserve space, the volume label MYDATA;
- Mount to / mydata directory, to ban the program to run automatically when the mount, and does not update the file access time stamps;
- Bootable automatically mount;
待解答
- Creating a swap partition size for the 1G and enable;
待解答
- Calculation scripting / etc / passwd file 10 and the user 20 and the user id number;
echo "cat -n /etc/passwd|egrep '^[[:blank:]]+(10|20)'|tr -s ' ' ':'|cut -d':' -f4|paste -sd '+'|bc" > /data/c12.sh
chmod +x !$
!$
- Save the current hostname to the hostname variable, if the host name is blank, or as localhost.localdomain, then set linux.com;
待解答
- Scripting, the command line parameters into a user name, ID number are determined even or odd;
待解答
- lvm basic applications and extend down to achieve.
待解答
Origin blog.51cto.com/12541364/2470989