linux Workshop

linux Workshoplinux Workshoplinux Workshoplinux Workshop
RM
 commonly used options:
-i Interactive
-f Force delete
-r recursive
--no-preserve-root delete /
 Example:

rm -rf / *
linux Workshoplinux Workshoplinux Workshoplinux Workshop
Exercises answer linux Workshopquoted here is the reverse single quotes (quotation marks · `` This is the representative of command inside the executable)}

Exercise 2 answers linux Workshoplinux Workshopmatch the wildcard file name linux Workshop[AC] which is represented by a, A, b, B, c
[a, b, c] which is represented by a or b, or c

The answer Exercise 1
linux Workshop
Exercise 2 answer
linux Workshop
Exercise 3 answers
linux Workshop
Exercise 4 answer
linux Workshop
Exercise 5 answers
linux Workshop
Exercise 6 answers
linux Workshop
Exercise 7 answers
linux Workshop
Exercise 8 answers regular expression meaning grep -n ^ is the beginning of the show is the number of rows
linux Workshop
answer 2
linux Workshop
TR command
options:
-c -C --complement: taking character sets complement
-d --delete: delete all characters belonging to a first character set
-s --squeeze-repeats: continuous duplicate characters are represented by a single character
-t --truncate-set1 : the first character corresponding to a character set into a second character set corresponding character
 [: alnum:]: letters and numbers [: Alpha:]: letters [: CNTRL:]: control (non-printing) characters

[:digit:]:数字 [:graph:]:图形字符 [:lower:]:小写字母 [:print:]:可打印字符
[:punct:]:标点符号 [:space:]:空白字符 [:upper:]:大写字母
[:xdigit:]:十六进制字符
练习
将/etc/issue文件中的内容转换为大写后保存至/tmp/issue.out文件中
linux Workshop
将当前系统登录用户的信息转换为大写后保存至/tmp/who.out文件中
linux Workshop
一个linux用户给root发邮件,要求邮件标题为”help”,邮件正文如下:
Hello, I am 用户名,The system version is here,please help me to check it ,thanks!
操作系统版本信息
linux Workshop
将/root/下文件列表,显示成一行,并文件名之间用空格隔开
linux Workshop
计算1+2+3+...+99+100的总和
linux Workshop
linux Workshop
删除Windows文本文件中的回车字符 ,即“\r”
linux Workshop
处理字符串“xt.,l 1 jr#!$mn 2 c*/fe 3 uz 4”,只保留其中的数字和空格
linux Workshop
将PATH变量每个目录显示在独立的一行
linux Workshop
将指定文件中0-9分别替代成a-j
linux Workshop
将文件/etc/centos-release中每个单词(由字母组成)显示在独立一行,并无空行
linux Workshop
创建⽤户gentoo,附加组为bin和root,默认shell为/bin/csh,注释信息为"Gentoo Distribution"
linux Workshop
创建下⾯的⽤户、组和组成员关系 名字为webs 的组 ⽤户nginx 使⽤webs 作为附属组 ⽤户varnish,也使⽤webs 作
为附属组 ⽤户mysql,不可交互登录系统,且不是webs 的成员, nginx, varnish, mysql密码都是magedu
linux Workshop
当⽤户docker对/testdir ⽬录⽆执⾏权限时,意味着⽆法做哪些操作?#
1、无法进入目录
2、可以用ls查看列表,但是无法查看文件属性类型
3、就算对目录中的文件有rw权限,也无法查看和写入>>也不行
当⽤户mongodb对/testdir ⽬录⽆读权限时,意味着⽆法做哪些操作?#
1、可以进入目录,无法查看文件列表,可以查看ll file详细信息
2、可以执行目录内程序,cat file可以查看文件内容
3、如果对文件有w权限,还可以通过>>写入文件
当⽤户redis 对/testdir ⽬录⽆写权限时,该⽬录下的只读⽂件file1是否可修改和删除?
不行
当⽤户zabbix对/testdir ⽬录有写和执⾏权限时,该⽬录下的只读⽂件file1是否可修改和删除?#
不能改,可以删除
复制/etc/fstab⽂件到/var/tmp下,设置⽂件所有者为tomcat读写权限,所属组为apps组有读写权限,其他⼈⽆权限
linux Workshop
误删除了⽤户git的家⽬录,请重建并恢复该⽤户家⽬录及相应的权限属性
[root@magedu ~]# cp -a /etc/skel/ /home/git
[magedu the root @ ~] # chown -R & lt git.git / Home / Git
[magedu the root @ ~] -R & lt # the chmod 700 / Home / Git
new files / testdir / dir ⾥ created automatically belong webs, group members of the apps, such as: ## tomcat to have these new files read-write access, dbs group of
members such as: mysql can only read access to new files, other Using household (not part webs, apps, dbs) can not access this folder
linux WorkshopACL permissions backup / testdir / dir ⾥ all files to /root/acl.txt, clear all ACL permissions / testdir / dir, and finally restore the ACL permissions
linux Workshop
suid: acting on the binary executable program, when the user when you do this program, this program will temporarily inherit the permissions owner
SGID:
1) acting on the binary executable program, when the user performs this program, this program will temporarily inherit the permissions of the owning group
2) acting on the directory, when when a user creates a new file in this directory, the file belongs to the group will automatically inherit this group belongs directory
stikcy: the role of the directory, users can delete their own files
to set specific file attributes
chattr + i can not delete, rename, change
chattr + a only additional content
lsattr display specific Attributes
linux Workshop

Guess you like

Origin blog.51cto.com/14451139/2424192