Linux Find command to understand and three time

Source: Internet
Author: User

This time explain the three Linux files displayed three times, and then show the various functions of the Find command

In the Linux operating system, each file has a lot of time parameters, of which three are compared to the main, respectively, ctime,atime,mtime

    • Modification Time (mtime):

When you modify the content data of the file, it will update the time, and change the permissions or properties, Mtime will not change, this is the difference with CTime

    • Status Time (CTime)

When you modify the permissions or attributes of the file, it will update the time, CTime is not create times, give me feel more like the change time, but this is not entirely correct, because only when the properties of the update file or permissions to update the date, Changes to the content will not be updated this time

    • Accesstime (Atime)

This time is updated when you use this file.

So why does atime not change when I use VIM to open a file? Because in my current version, with the concept of relatime , if we frequently read access to the file, will be frequently modified atime, and then frequent access to disk I/O, performance degradation is very serious, to tell the truth, slow! After using the Relatime parameter, atime will not be updated unless the Atime is earlier than Mtime or CTime

Tragedy, the Chinese Linux three time translation over ...

Find command in detail, it has a lot of features, very strong, real-time very strong, every find a file will be very honest to go to the disk to find, so it is very slow ...

The Find command has a number of parameters, and the following is used to one by one description

    • -name filename #查找名为filename的文件, and put it in a picture below.
    • -perm #按执行权限来查找, use permission code when you use permissions lookup.

    • -user username #按文件属主来查找
    • -group GroupName #按组来查找

    • -mtime-n +n #按文件更改时间来查找文件,-n means n days or less, +n means n days ago
    • -atime-n +n #按文件访问时间来查GIN: 0px ">
    • -ctime-n +n #按文件创建时间来查找文件,-n means n days or less, +n means n days ago

After seeing the-N here, it's natural to think that +n is n days later? I think about it, how can I create a file in the future ...

Almost all of the same files were found because I seldom went to Linux to create new files, but instead took the Windows files directly through the disk share ...

    • -nogroup #查无有效属组的文件 that the genus of the file does not exist in the/etc/groups

I don't think we have a file like that.

    • -nouser #查无有效属主的文件, that is, the owner of the file does not exist in the/etc/passwd

There seems to be no such thing.

    • -newer F1!f2 #查更改时间比f1新但比f2旧的文件, use the time to pay attention to F1 and F2 should have-newer parameters before the line

    • -type b/d/c/p/l/f #查是块设备, directories, character devices, pipelines, symbolic links, plain files

I first set up a pipeline file and then search for a file of type pipe file (...). )

    • -size N[c] #查长度为n块 [or N-byte] files

I can't do this.

    • -Depth #使查找在进入子目录前先行查找完本目录

To my feeling, this is more like walking through the folder of all the files look like, when the sub-directory does not go into the sub-directory traversal, but instead of traversing all the files under the current folder and then go through the subdirectories (that is, subfolders) of the file, so constantly recursive ... isn't that a sequence traversal?

    • -fstype: Find files located in a type of file system, file system types can be found in/etc/fstab

What does this parameter mean not to be too understanding, to test a little bit to find nothing, I don't know how to test him

    • -mount #查文件时不跨越文件系统mount点

This parameter seems to be not allowed to go to the subdirectory to find, I tried, sub-directory files that are not found

    • -follow #如果遇到符号链接文件, just follow the file that the link refers to

I used a hard link also tracked out, is it possible?

This is good to understand, it will be all the link files are found, I do not understand the Linux command sequence what is going on, but also do not understand the man and help, you laugh at me

    • -cpio #对匹配的文件使用cpio命令, back them up to tape devices

After the normal search results, write the file backup to disk ...

    • -prune #忽略某个目录

Let's not say that ....

Finally, I strongly urge you to criticize!! I have a lot of not know the place, point out I will be super grateful!

Linux Find command to understand and three time

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.