Mkdir for Linux Command File Processing

Source: Internet
Author: User

The following describes the 60 required Linux commands that must be mastered by new users. If you have mastered these commands, your technology will be greatly improved, we hope that the technology will be greatly improved after reading this article.

Commands required for Linux (2)-file processing commands
Linux
System information is stored in files, which are similar to common official files. Each file has its own name, content, storage address, and other management information, such as the user and size of the file. The file can be
A letter, an address book, or program source statement, program data, or even executable programs and other non-body content.
The Linux File System has a good structure and provides many file processing programs. This section describes common file processing commands.
File
1. Determine the file type of the role content. The permission is granted to all users.
2. Format
File
File [options] file Name
3. [options] Main Parameters
-V: displays the version information after the standard output and exits.
-Z: detects the compressed file type.
-L: the connection is allowed.
-F name: read the list of file names to be analyzed from the file namefile.
4. Simple Description
You can use the file command to know whether a file is in the binary ELF format. File can recognize the following file types: Directory, Shell script, English text, binary executable file, C language source file, text file, DOS executable file.
5. Application Instance
If we see a file grap without a suffix, we can use the following command:
$ File grap
Grap: English text
This is an English text file. It must be noted that the file command cannot detect multimedia file types, such as graphics, audio, and video.
Mkdir
1. Role
The mkdir command is used to create a subdirectory named dirname. Similar to the md command in ms dos, the command has the permission of all users.
2. Format
Mkdir [options] Directory Name
3. [options] Main Parameters
-M, -- mode = mode: Set permissions, similar to chmod.
-P, -- parents: Create the upper-level directory when necessary. If the directory already exists, it is not treated as an error.
-V, -- verbose: information is displayed every time a new directory is created.
-- Version: displays the version information and leaves.
4. Application Instance
You can set the directory permission when creating a directory. The "-m" parameter is used ". Assume that the directory to be created is named "tsk", so that all users have the rwx (read, write, and execute permissions), you can use the following command:
$ Mkdir-m 777 tsk
Grep
1. Role
The grep command can specify the file to search for specific content and output the row standard output containing the content. Grep stands for Global Regular Expression Print, which indicates the Global Regular Expression version. Its permission is granted to all users.
2. Format
Grep [options]
3. Main Parameters
[Options] main parameters:
-C: only counts matching rows are output.
-I: case-insensitive only applies to single characters ).
-H: When querying multiple files, the file name is not displayed.
-L: When querying multiple files, only names containing matching characters are output.
-N: displays matching rows and row numbers.
-S: the error message that does not exist or does not match the text is not displayed.
-V: displays all rows that do not contain matched text.
Main Parameters of the regular expression pattern:
\: Ignore the original meaning of special characters in regular expressions.
^: Match the start line of the regular expression.
$: Matches the end row of the regular expression.
\: Ends with the row matching the regular expression.
[]: A single character. For example, [A] indicates that A meets the requirements.
[-]: Range, such as [A-Z], that is, A, B, C Until Z all meet the requirements.
. : All single characters.
*: It can contain 0 characters.
Zheng
Expressions are very important concepts in Linux/Unix systems. A regular expression, also known as "regex" or "regexp") is a pattern that can describe a type of string.
Pattern ). If a string can be described using a regular expression, we can say that this character matches the regular expression ). This allows you to use wildcards in DOS.
"*" Indicates that any character is similar. In Linux, regular expressions are usually used to find the text mode and perform the "search-Replace" operation and other functions on the text.
4. Application Instance
Query
DNS is one of the daily tasks. This means that you need to maintain a large number of IP addresses covering different networks. Sometimes the number of IP addresses exceeds 2000. If you want to view the nnn. nnn network address, but forget
The rest of the second part only knows that there are two periods, such as nnn nn... To extract all the nnn. nnn IP addresses, use [0-9] \ {3
\} \. [0-0 \ {3 \}\. It means that any number appears three times, followed by a sentence, followed by any number three times, followed by a sentence.
$ Grep '[0-9] \ {3 \} \. [0-0 \ {3 \} \ 'ipfile
In addition, the grep family also includes fgrep and egrep. Fgrep is a fix grep that allows you to search for strings rather than a pattern. egrep is an extended grep that supports basic and extended regular expressions, however, it does not support the application of the \ q mode and some more standardized models.

Click mandatory Linux Command File Processing Command 2 below to continue viewing.

  1. Fedora Display Device Configuration tool 1)
  2. Fedora Display Device Configuration tool Introduction 2)
  3. Basic knowledge of Hardware Management in Linux system 3)
  4. Basic knowledge of Hardware Management in Linux system 4)
  5. Ubuntu Linux is suitable for at least five people

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.