Unit II
1. Create a file with commands and regular expressions as required
*) Create 12 files with one command Westos_classx_linuxy (the value range of x is 1-2,y 1-6)
*) These files are included in the study directory of the root user's desktop
[[email protected] desktop]# Touch study/westos_class{1,2}_linux{1..6}
[Email protected] desktop]# MV study/westos_class{1,2}_linux{1..6} study
*) Create 8 files with one command Redhat_versionx (the range of x is 1-8)
*) Redhat_virsionx These files are included in version in the/MNT directory
[[email protected] desktop]# redhat_version{1..8}
[Email protected] desktop]# mkdir/mnt/version
[Email protected] desktop]# mn redhat_version{1..8}/mnt/version
2. Management of the documents just established by the letter is as follows
*) Copy the odd files in the Redhat_versionx to the single in the desktop with one command
[[email protected] desktop]# cp/mnt/version/redhat_version{1,3,5,7} single
*) copy files with even numbers in Redhat_versionx to/double with a single command
[Email protected] desktop]# cp/mnt/version/redhat_version{2,4,6}/double
*) use a command to move the Class1 file in Westos_classx_linuxy to the CLASS1 of the current user's desktop
[Email protected] desktop]# MV study/westos_class1_linux{1..6} CLASS1
*) use a command to move the Class2 file in Westos_classx_linuxy to the CLASS2 of the current user's desktop
[Email protected] desktop]# MV study/westos_class2_linux{1..6} CLASS2
3. Back up all the files in the/etc directory with the names with numbers and end with. conf to the Confdir on the desktop
[Email protected] desktop]# cp/etc/*[[:d igit]]*.conf confdir
4. Delete all files you have just created or backed up
[Email protected] desktop]# RM-FR single CLASS1 CLASS2 study confdir/mnt/version
This article is from the "12097647" blog, please be sure to keep this source http://12107647.blog.51cto.com/12097647/1858091
The second unit. Brief regular expressions and moving copies of files