(C) User Group job conduit

1, the display / etc directory, start with a non-letter followed by a letter of any length and any other files or directories characters

ls /etc/ | grep '^[^a-zA-Z][a-zA-Z]'

2, the next copy / etc directory of all start with p, ending in a non-digital files or directories to / tmp / mytest1 directory

cp -r `ls /etc/ | sed -rn '/^p.*[^0-9]$/ s#^p#\/etc\/p#p'` /tmp/mytest1/

3, the contents of / etc / issue file conversion to save a file after capital /tmp/issue.out

cat /etc/issue | tr 'a-z' 'A-Z' > /tmp/issue.out

4, please use summary description of user and group management class command and complete the following exercise:
(1) create a group distro, its GID of 2019;

groupadd -g 2019 distro

(2) creating a user Mandriva, its ID number is 1005; substantially Distro group;

useradd -u 1005 mandriva -g distro

(3) create a user mageia, its ID number is 1100, the home directory is / Home / Linux;
useradd -u 1100 mageia -d /home/linux
(4), to the user mageia add a password, the password is mageedu, and set user passwords expire after 7 days

echo mageedu | passwd --stdin mageia;passwd -x 7 mageia

(5), delete mandriva, but retain their home directory;

userdel mandriva

(6), to create a user Slackware, its ID number is 2002, the basic group Distro, additional sets peguin;

useradd -u 2002 slackware -g distro -G peguin

(7), to modify the default shell slackware / bin / tcsh;

usermod -s /bin/tcsh slackware

(8), to add additional user slackware Admins group;

usermod -aG admins slackware

Guess you like

Origin blog.51cto.com/14599947/2452821