Linux New files and directories

Source: Internet
Author: User
Tags create directory

This blog if there is insufficient to write the place also hope that readers will not hesitate to enlighten

Introduce the symbol in the blog: [] Everything is not fixed, ... Indicates that there can be more than one!

Basic knowledge of files

File metadata: Non-file components, including: file name, size, type, permissions, the genus owner Group, the timestamp of the file

File data: Content in a file (part of a file)

Three timestamps of files

Accesstime : File access time; shorthand "atime" to read the contents of the file

Modifytime : File modification time; abbreviated "Mtime", content changed

Changetime : File change time; abbreviated "CTime", metadata changed

Touch command to create a new file and change the timestamp of the file

Syntax: touch [filename ...]

Touch [ Options ...] [filename ...]

Options:

-A : Change access time only

- C : Do not create any files

- M : Change only modified time

- D : Change access time and modification time at the same time

- T : Use the specified timestamp instead of the current time, if the file exists, change the file's access time and the time stamp for the file's modification time, if the file does not exist, create a file, specify the access time of the file and the time stamp of the file modification time; Format: "Month day hour minute."


mkdir Command Create a new directory

Syntax: mkdir [filename ...]

mkdir [ Options ...] [File name]

Options:

- P : Continuous creation of multi-level catalogs; directory presence not error

- v : Show creation Process

- M : Add octal permission bit after option; Set permissions to create directory

New file or directory considerations

1. file names are strictly case sensitive

2. file name can use any character except "/", special characters are not recommended

3. The maximum length of the file name cannot exceed 255 characters

4. file name with "." Files that begin with are hidden files

5. If there is a space in the file name, enclose it in quotation marks ""

For a command to view file metadata, I'll introduce you in the next blog post

Finally write to the friend who is learning Linux: Want to learn Linux more practice, light can not learn, light listen also learn not, only more practice to know the mastery of Linux

If you do not know anything about this blog or have any suggestions can give me a message, your support is my future to write the power of the blog


Linux New files and directories

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.