[CentOS Linux 7] Experiment 1 [Linux file directory management]

table of Contents

1. The purpose of the experiment

2. Experimental content

3. Experimental procedures and results

Four, experiment summary


1. The purpose of the experiment

  1. Master the entry, exit and common commands of the command line interface of the Linx operating system.
  2. Master the commands commonly used in Linux systems such as viewing and switching directories.
  3. Understand and use common commands for file directory management.
  4. Master the file directory authority management of Linux system.

2. Experimental content

1. Entry and exit of the command line interface.

  • a) Use the menu to open a terminal window to enter the command line and exit
  • b) Use the combination key ctrl+alt+Fn to switch to the command line terminal and log in to the system as the root user.

2. Practice frequently used commands.

  • a) Practice using the man help command to view the functions of touch, mkdir, and cat commands.
  • b) Use the pwd command to view the current directory, and use the cd command to switch the directory to some other directory, and use pwd to view the current path and the ls and ls -l commands to view the directories and files in the current path.
  • c) Use cat and more commands to view files /etc/passwd and /etcadow.
  • d) Use the echo command to display a sentence introducing your name.
  • e) Su command practice, switch between user root and student.
  • f) The vi editor edits a text file, freely design the text content, after the writing is successfully saved, use the cat command to view the content of the text.

3. Practice of automatic completion of command and directory file names (tab key).

4. Use commands to view the attributes of all files in the /root directory, and respectively point out what type of file each file is, as well as the file owner user, the owner's group user, and other users' access rights to each file.

5. Practice the file directory operation management commands ls\mkdir\cp\mv\rm, etc., use the command to create a folder named after your own pinyin in the /home/ directory, and use the command to create file1, file2, File3, file10, file20 files and create two directories dir1, dir2, and then use wildcards to delete files file1, file2 and file3. Copy the folder named with your own pinyin to the /tmp/ directory, and then delete the folder named with your own pinyin in the /home directory. In the folder of /tmp/ your own name, use the vi editor to edit the hello.c file to achieve hello world output.

6. Use characters to modify file and directory permissions. (a) The root user uses the touch command to create the file /tmp/test, and uses characters to set the file owner user to have read and write permissions on the file, the owner’s group and other users No read and write permissions, and use the ls -l command to check whether the permissions are set correctly. (B) Create the /tmp/dir directory as the root user, move the /tmp/test file to the /tmp/dir directory, then set the permissions of the dir directory to rwx------, then switch to a normal user and try to view The dir directory and enter the dir directory.

7. Use digital methods to modify file and directory permissions exercises, use digital methods to repeat the content of task 6, or design other file directory permissions management tasks.

3. Experimental procedures and results

1. Entry and exit of the command line interface

  • a) Use the menu to open a terminal window, enter the command line, and exit;

  • b) Use the combination key ctrl+alt+Fn to switch to the command line terminal and log in to the system as the root user.

Enter the command terminal: Ctrl + Alt + Fn + F2; return to the graphical interface: Ctrl + Alt + Fn + F2.

2. Practice frequently used commands.

  • a) Practice using the man help command to view the functions of touch, mkdir, and cat commands.

    

    

  • b) Use the pwd command to view the current directory, and use the cd command to switch the directory to some other directory, and use pwd to view the current path and the ls and ls -l commands to view the directories and files in the current path.

  • c) Use cat and more commands to view files /etc/passwd and /etcadow.

  • d) Use the echo command to display a sentence introducing your name.

  • e) Su command practice, switch between user root and student.

  • f) The vi editor edits a text file, freely design the text content, after the writing is successfully saved, use the cat command to view the content of the text.

   

3. Practice of automatic completion of command and directory file names (tab key).

4. Use commands to view the attributes of all files in the /root directory, and respectively point out what type of file each file is, as well as the file owner user, the owner's group user, and other users' access rights to each file.

5. Practice the file directory operation management commands ls\mkdir\cp\mv\rm, etc., use the command to create a folder named after your own pinyin in the /home/ directory, and use the command to create file1, file2, file3, file10, file20 files and create two directories dir1, dir2,

Then use wildcards to delete files file1, file2 and file3. Copy the folder named with your own pinyin to the /tmp/ directory, and then delete the folder named with your own pinyin in the /home directory.

In the folder of /tmp/ your own name, use the vi editor to edit the hello.c file to achieve hello world output.

6. Use characters to modify file and directory permissions. (a) The root user uses the touch command to create the file /tmp/test, and uses characters to set the file owner user to have read and write permissions on the file, the owner’s group and other users No read and write permissions, and use the ls -l command to check whether the permissions are set correctly.

(B) Create the /tmp/dir directory as the root user, move the /tmp/test file to the /tmp/dir directory, then set the permissions of the dir directory to rwx------, then switch to a normal user and try to view The dir directory and enter the dir directory.

7. Use digital methods to modify file and directory permissions exercises, use digital methods to repeat the content of task 6, or design other file directory permissions management tasks.

Four, experiment summary

This experiment, completed independently, is very simple.

Guess you like

Origin blog.csdn.net/weixin_44949135/article/details/108894746