8-30 Exercises

Source: Internet
Author: User

1, summarize the text editing tool vim use method;

2, summarize the document Search command find use method;

3. Summarize the content of Bash environment variable and special permission on Linux file System .

4 , summarizes the Linux Disk Management, the file system related knowledge point and the related command use method;

Vim Exercises:
1, copy the/etc/grub2.cfg configuration file to the/tmp directory, use the Find replacement command to delete the/tmp/grub2.cfg file at the beginning of the blank character;
CentOS:/etc/grub.conf

:%[email protected]^[[:space:]]\[email protected]@

2. Copy the/etc/rc.d/init.d/functions file to the/tmp directory, and add a # to the beginning of the line beginning with a blank character for each line of/tmp/functions with the find replacement command; The original whitespace character is reserved;

:%[email protected]^[[:space:]]@#&

3, replace the/etc/sysconfig/init in/tmp/functions file is/var/log;

:%[email protected]/etc/sysconfig/[email protected]/var/[email protected]

4. Delete the beginning of the line in the/tmp/functions file so #, and # followed by at least one blank character #;

:%[email protected]^#[[:space:]]@[[:space:]]

The Find command exercises:
1, find the/var directory is the owner of the root, and belong to the group mail all files;

#find/var-user root-group mail-ls

[Email protected] ~]# Find/var-user root-group mail-ls
261125 4 Drwxrwxr-x 2 root mail 4096 Jan 1 08:27/var/spool/mail
2. Find all files that are not root, bin or hadoop under the/usr directory;

#find/usr-not-user root-a-not-user bin-a-not-user hadoop-ls

or #find/usr-not \ (-user root-o-user bin-o-user hadoop \)-ls

[Email protected] ~]# find/usr-not-user root-a-not-user bin-a-not-user hadoop-ls
0-rw-r--r--1 gentoo Root 0 Jan 1 13:58/usr/text1.txt

3. Find all files whose contents have been modified and are not root or Hadoop for the last week in/etc directory;


4. Find all files on the current system that are not owned by the master or group, and have been visited in the last week;
5. Find all files of more than 20k and type of ordinary person in/etc directory;
6, look for all the users in/etc directory do not have permission to write files;
7. Find at least one class of users who do not have permission to execute files in/etc directory;
8, find/etc/init.d directory, all users have execute permission, and other users have write permission files;

8-30 Exercises

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.