admin 管理员组

文章数量: 887021


2024年2月20日发(作者:一般属性克制什么属性)

shell find -newermt用法

The `find -newermt` command is used to search for files and

directories that were modified after a specific date and time.

The basic syntax of the `find -newermt` command is:

```

find -newermt

```

Here's an example to find all files modified after a certain date and

time:

```

find /path/to/directory -newermt "2022-01-01 00:00:00"

```

This command will search for all files and directories in the

specified directory (`/path/to/directory`) that were modified after

January 1, 2022, 00:00:00.

You can also use relative dates and times with the `-newermt`

option. For example, to find all files modified within the last 7

days, you can use:

```

find /path/to/directory -newermt "-7 days"

```

In this example, `-7 days` represents a relative date and means

"within the last 7 days".

You can further combine the `-newermt` option with other `find`

command options to narrow down the search criteria, such as file

type, size, or ownership.

Note that the `-newermt` option is available in GNU find version

4.3.3 and later. If you're using a different version of the `find`

command, you may need to use alternative options or methods to

achieve the same result.


本文标签: 属性 克制 作者