1, the Replication/etc/skel directory is/home/tuser1, requires/home/tuser1 and its internal files belong to the group and other users do not have any access rights.
Cp-r/etc/skel//home/tuser1
Chmod-r 700/home/tuser1
2. Edit the/etc/group file and add the group Hadoop.
echo "hadoop:x:1103" >>/etc/group
3. Manually edit the/etc/passwd file to add a new line, adding user Hadoop, whose basic group ID is the Hadoop group ID number; its home directory is/home/hadoop.
echo "Hadoop:x:1103:1103::/home/hadoop" >>/etc/passwd
4. Copy the/etc/skel directory as/home/hadoop, which requires that the genus Group and other users of the Hadoop directory be modified without any access rights.
Cp-r/etc/skel/home/hadoop
Chmod-r 700/home/hadoop
5, modify the/home/hadoop directory and all the internal files of the owner of Hadoop, belong to Hadoop group.
Chown-r Hadoop:hadoop/home/hadoo
6. Display the lines in the/proc/meminfo file beginning with uppercase or lowercase s, in two ways;
Grep-i ^s/proc/meminfo
Egrep ^[s,s]/proc/meminfo
7. Display the default shell of the/etc/passwd file as a non-/sbin/nologin user;
Grep-v sbin/nologin/etc/passwd
8. Display the user whose default shell is/bin/bash in/etc/passwd file;
grep/bin/bash/etc/passwd
9. Find out one or two digits in the/etc/passwd file;
grep [[:d igit:]][1,2]/etc/passwd
10. Display the line beginning with at least one blank character in/boot/grub/grub.conf;
cat/boot/grub/grub.conf |grep ^[[:space:]]
11, the display/etc/rc.d/rc.sysinit file with the beginning of #, followed by at least one white space character, and then have at least one non-whitespace character line;
grep ^#[[:space:]]/etc/rc.d/rc.sysinit
12, the Netstat-tan command execution results in the "LISTEN", followed by or with a blank character end of the line;
Netstat-tan|grep Listen[[:space:]]
13, add user bash, Testbash, basher, Nologin (this one user's shell is/sbin/nologin), and then find the current system on its user name and the default shell of the same user information;
Useradd Bash
Useradd Testbash
Useradd basher
Useradd-s/sbin/nologin Nologin
grep--color "^\ ([[: alnum:]]\+\). *\1$"/etc/passwd
Linux Learning Assignments-fourth week