练习题
[root@centos8 ~]#cat /etc/issue \S Kernel \r on an \m tty: \l hostname: \n time: \t
2、
[root@centos8 ~]#shutdown 18:30 "Your system will automaticlly shutdown at 18:30,please save your file."
[root@centos8 ~]#cp -av /etc/ /data/backup`date +%F`/
[root@centos8 ~]#mkdir -p testdir/dir1/{x,y}/{a,b}
[root@centos8 x]#mkdir -p testdir/dir2/{x/{a,b},y}
[root@centos8 x]#mkdir -p testdir/dir{3,4,5/dir{6,7}}
[root@centos8 ~]#who |tr 'a-z' 'A-Z' > /tmp/who.out [root@centos8 ~]#who |tr '[:lower:]' '[:upper:]' > /tmp/who1.out
[zhang@centos8 root]$mail -s "help" root <<EOF > Hello,I am `id -nu`. > The system version is here,please help me to check it,thanks! > `cat /etc/redhat-release` > EOF
[root@centos8 ~]#ls /root |tr '\n' ' '
[root@centos8 ~]#echo {1..100} |tr ' ' '+'|bc [root@centos8 ~]#seq -s+ 100 |bc [root@centos8 ~]#sum=0;for i in {1..100};do let sum+=i;done;echo sum=$sum [root@centos8 ~]#seq 100|paste -sd +|bc
[root@centos8 ~]#cat win1.txt|tr -d '\r' >win2.txt [root@centos8 ~]#tr -d '\r' < win1.txt > win3.txt
[root@centos8 ~]#echo 'xt.,11jr #!$mn2c*/fe3uz4' |tr -dc '[:digit:][:space:]'
[root@centos8 ~]#echo $PATH | tr ':' '\n'
[root@centos8 ~]#cat f1.txt |tr '[0-9]' '[a-j]'
[root@centos8 ~]#cat /etc/centos-release|tr -dc [:alpha:][:space:]|tr -s ' ' '\n'
16、
[root@centos7 ~]#useradd -G bin,root -s /bin/csh -c 'Gentoo Distribution' gentoo
[root@centos7 ~]#groupadd webs [root@centos7 ~]#useradd -G webs nginx [root@centos7 ~]#useradd -G webs varnish [root@centos7 ~]#useradd -s /sbin/nologin mysql [root@centos7 ~]#passwd mysql [root@centos7 ~]#passwd varnish [root@centos7 ~]#passwd nginx
用户docker不能切换至/testdir目录访问目录内的文件。
可以删除,不可以修改。
useradd tomcat groupadd apps cp /etc/fstab /var/tmp cd /var chown tomcat:apps tmp chmod 660 tmp
mkdir /home/git cp -r /etc/skel/. /home/git/ chown git:git /home/git chmod 700 /home/git