J-Linux & Shell-W5 file operation

J-Linux&Shell-W5

File operation (10 points in total)

1. Judgment questions (4 questions in total, 0.25 points per question)

  1. There is a file in the system named aaa.txt, then the extension of this file is txt. (×)

  2. Assuming that there is a file named x11 in the current workspace, and the file content is also x11, then using the command grep -v [0-9] x11 in this workspace can't grab this line. (√)

  3. The file command is used to display the statistical information of the file. (×)

  4. The wc command is used to query the file type. (×)

2. Single-choice questions (3 questions in total, 0.5 points for each question)

  1. The maximum length of the file name of the Linux operating system is (A)

    A.2^8-1 B.2^4-1 C.2^16-1 D.2^32-1

  2. Regarding the more command, the wrong statement is (D)

    A.more can display the contents of long files in order from the beginning

    B.more can split the contents of long files according to the screen size

    C.more after a long file, click the space to turn the page, click Enter to turn the line

    The contents of the D.more command that have been turned up cannot be viewed back.

  3. The following description is correct (D)

    A. Regular expressions have the same meaning as the system wildcards.

    B. [0-9] represents the 10 characters 0-9

    C. {2} represents 2 occurrences 2 times

    D. All of the above are wrong

3. Indeterminate multiple choice questions (2 questions in total, 1 point for each question)

  1. The following commands can be used independently to achieve the effect of viewing files (ACD)

    A.vi      B.echo      C.cat      D.more
    
  2. The following commands can be used independently to achieve the effect of editing files (A)

    A.vi      B.echo      C.cat      D.more
    

4. Fill in the blanks (2 blanks, 0.5 points per blank)

  1. The combination of commands and options that can modify file modification time information in the system is touch -d.

  2. The linux operating system can be formal 文件扩展名, but the system does not use it as a basis for distinguishing file types, which is different from the windows system.

V. Questions and answers (1 question, 4.5 points)

  1. Please describe the differences between cat, more, less, head, and tail view file commands.
  • The cat command connects files and prints them to a standard output device. cat is often used to display the contents of files and is used for smaller files.

  • The more command is a text editor based on the vi editor. It displays the contents of text files on a page-by-page basis in a full-screen manner, and has the function of split-screen display.

  • The less command is very similar to more, and can be used to browse the contents of text files. Less supports pagedown and pageup line turning, and can implement specific keyword queries.

  • The head command is used to display the beginning of the file. By default, the head command displays the first 10 lines of the file.

  • The tail command is used to input the tail content in the file. The tail command displays the last 10 lines of the specified file on the screen by default.

Published 16 original articles · won praise 16 · views 6445

Guess you like

Origin blog.csdn.net/tianxujituan/article/details/105155674