Find Files that are Modified Today (or Since Certain Time Ago) in Unix Tìm tập tin được sửa đổi Hôm nay (hoặc từ nhất định Thời gian trước) trong Unix

To find all files that was modified since a specific time ago (ie an hour ago, a day ago, 24 hours ago, a weeks ago and so on) in Unix environment, the find command will come in handy. Để tìm tất cả các file đã được sửa đổi kể từ một thời gian cụ thể trước (tức là một giờ trước, một ngày trước, 24 giờ trước, một tuần trước và vv) trong môi trường Unix, các lệnh sẽ thấy có ích. The command syntax is: Cú pháp lệnh là:

To find all files modified in the last 24 hours (last full day) in current directory and its sub-directories: Để tìm tất cả các file sửa đổi trong 24 giờ qua (cuối đầy đủ ngày) trong thư mục hiện hành và thư mục con của nó:

find . tìm. -mtime -1 -print -Mtime -1-in

Flag -mtime -1 option tells find command to look for files modified in the last day (24 hours). Cờ-Mtime -1 tùy chọn cho thấy lệnh để tìm tập tin sửa đổi trong ngày cuối cùng (24 giờ). Flag -print option will cause find command to print the files' location. Cờ-in tùy chọn sẽ gây ra tìm lệnh in vị trí của tập tin. -print can be replaced with -ls if you want a directory-listing-type response. -in có thể được thay thế bằng-ls nếu bạn muốn có một thư mục-danh-loại phản ứng.

To find all files modified in the last 24 hours (last full day) in a particular specific directory and its sub-directories: Để tìm tất cả các file sửa đổi trong 24 giờ qua (cuối đầy đủ ngày) trong một thư mục cụ thể nói riêng và phụ của thư mục:

find /directory_path -mtime -1 -print tìm / directory_path-Mtime -1-in

The command is basically the same with the earlier command, just that now you no need to cd (change directory) to the directory you want to search. Lệnh này về cơ bản giống với lệnh trước đó, chỉ rằng bây giờ bạn không cần phải thay đổi thư mục cd () vào thư mục bạn muốn tìm kiếm.

To find all files with regular file types only, and modified in the last 24 hours (last full day) in current directory and its sub-directories: Để tìm tất cả các file với các loại tập tin thường xuyên chỉ, và sửa đổi trong 24 giờ qua (cuối đầy đủ ngày) trong thư mục hiện hành và thư mục con của nó:

find /directory_path -type f -mtime -1 -print tìm / directory_path-type f-Mtime -1-in

To find all files that are modified today only (since start of day only, ie 12 am), in current directory and its sub-directories: Để tìm tất cả các tập tin được sửa đổi hôm nay chỉ (kể từ ngày bắt đầu chỉ, tức là 12:00), trong thư mục hiện hành và thư mục con của nó:

touch -t `date +%m%d0000` /tmp/$$ touch-t `date +% m% d0000` / tmp / $ $
find /tmefndr/oravl01 -type f -newer /tmp/$$ tìm / tmefndr/oravl01-type f-mới / tmp / $ $
rm /tmp/$$ rm / tmp / $ $

The first command can be modified to specify other date and time, so that the commands will return all files that have changed since that particular date and time. Lệnh đầu tiên có thể được sửa đổi để xác định ngày khác và thời gian, do đó, các lệnh sẽ trả về tất cả các file đã thay đổi kể từ ngày đó cụ thể và thời gian.

IMPORTANT : The page is machine translated and provided "as is" without warranty. Quan trọng: Sửa là máy dịch và cung cấp "như là" không có bảo hành. Machine translation may be difficult to understand. Máy dịch thuật có thể khó hiểu. Please refer to Vui lòng tham khảo original English article bản gốc tiếng Anh bài viết whenever possible. bất cứ khi nào có thể.


12 Responses to “Find Files that are Modified Today (or Since Certain Time Ago) in Unix” 12 Responses to "Tìm tập tin được sửa đổi Hôm nay (hoặc từ nhất định Thời gian trước) trong Unix"

  1. Mike Mike
    June 30th, 2009 06:53 Ngày 30 Tháng Sáu 2009 06:53
    12 12

    Question: If one does a find for files modified in the last two minutes, and it takes the command ten minutes to complete, is that going to fail completely? Hỏi: Nếu một trong những hiện một tìm cho các tập tin sửa đổi trong hai phút cuối, và nó có lệnh mười phút để hoàn thành, là sẽ không hoàn toàn?

  2. Bruno De Barros Bruno De Barros
    June 11th, 2009 15:46 Ngày 11 Tháng 6 Năm 2009 15:46
    11 11

    @Kiran Kappeta, it works for me on Ubuntu. @ Kiran Kappeta, nó hoạt động đối với tôi trên Ubuntu. Try to see if it supports any non-integer values at all (for example, try 0.5 or 0.25). Hãy thử xem nếu nó hỗ trợ nào không phải ở tất cả các giá trị số nguyên (ví dụ, hãy thử 0,5 hoặc 0,25). If it doesn't, there's your problem. Nếu không, có vấn đề của bạn.

  3. Kiran Kappeta Kiran Kappeta
    June 4th, 2009 21:02 4 Tháng Sáu 2009 21:02
    10 10

    Good one. Good one. Thanks. Cảm ơn.

    Tried Cố gắng

    find . tìm. -mtime -0.041666667 -print -Mtime -0,041666667-in

    on Debian, it throws an error trên Debian, nó ném một lỗi
    “find: invalid argument `-0.041666667′ to `-mtime'” "Tìm thấy: đối số không hợp lệ` -0,041666667 'to `-Mtime'"

  4. Bruno De Barros Bruno De Barros
    June 4th, 2009 20:02 4 Tháng Sáu 2009 20:02
    9 9

    Additionally, to find files modified less than an hour ago: Ngoài ra, để tìm tập tin sửa đổi ít hơn một giờ trước đây:
    find . -mtime -0.041666667 -print

    Simply divide 1 by 24 (24 hours) and you'll get what you want. Đơn giản chỉ cần chia 1 của 24 (24 giờ) và bạn sẽ có được những gì bạn muốn. For example, 0.1 is 2 hours and 24 minutes. Ví dụ, 0,1 là 2 giờ và 24 phút.

    I hope this helps whoever needs to find files modified LESS than one full day ago. Tôi hy vọng điều này sẽ giúp ai nhu cầu để tìm tập tin đổi LESS đầy đủ hơn một ngày trước đây. :)

    —– --
    Bruno De Barros Bruno De Barros

  5. Susmita Susmita
    May 14th, 2009 16:00 Ngày 14 tháng 5 năm 2009 16:00
    8 8

    thanks a lot for the good article. cảm ơn rất nhiều cho bài viết tốt.

  6. Prabhakar Prabhakar
    February 20th, 2009 21:22 Ngày 20 Tháng Hai 2009 21:22
    7 7

    It was of timely help Nó được trợ giúp kịp thời :)
    Thanks. Cảm ơn.

  7. RuBiCK RuBiCK
    December 12th, 2008 20:36 Ngày 12 Tháng 12 2008 20:36
    6 6

    And how you will find files by specified hour? Và làm thế nào bạn sẽ tìm thấy tập tin theo giờ quy định?

    example. ví dụ. Files modified in last 8hours, if now, the time is 01AM Tệp đổi trong 8hours cuối, nếu bây giờ, thời gian là 01:00

  8. Deiby Deiby
    November 12th, 2008 21:08 Tháng 11 12, 2008 21:08
    5 5

    Thanks!! Thanks!!

  9. Recently Modified Files : mnavasca.ca Gần đây Modified Files: mnavasca.ca
    October 1st, 2008 04:19 01 tháng 10 năm 2008 04:19
    4 4

    [...] be useful when I'm syncing files from our dev server to our production server. [...] Có ích khi tôi đồng bộ hoá tập tin từ máy chủ dev của chúng tôi để sản xuất máy chủ của chúng tôi. And thanks to this post I've finally found [...] Và nhờ có bài đăng cuối cùng tôi đã tìm thấy [...]

  10. Finding files modified since a certain time « Tech Notes @ Fernvale Tìm tập tin sửa đổi kể từ một thời gian nhất định «Tech Notes @ Fernvale
    June 30th, 2008 11:46 30 Tháng Sáu 2008 11:46
    3 3

    [...] References: [...] Tham khảo: http://www.mydigitallife.info/2006/01/19/find-files-that-are-modified-today-or-since-certain-time-ag.. http://www.mydigitallife.info/2006/01/19/find-files-that-are-modified-today-or-since-certain-time-ag .. . . [...] [...]

  11. einstein Einstein
    May 7th, 2008 15:35 07 Tháng 5 2008 15:35
    2 2

    Very good article, thanx! Rất tốt bài viết, thanx!

  12. iPAS IPAS
    August 4th, 2007 08:59 Ngày 4 tháng 8 năm 2007 08:59
    1 1

    Great Thnks! Great Thnks!

Leave a Reply Để lại một trả lời

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> Bạn có thể sử dụng các thẻ: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime = ""> <em> <i> <q <strike> <strong>

Subscribe to comments feature has been disabled. Thuê bao với ý kiến đều đã bị vô hiệu hoá. To receive notification of latest comments posted, subscribe to Để nhận được thông báo mới nhất đăng ý kiến, đăng ký với My Digital Life Comments RSS feed My Digital Life kiến RSS feed or hoặc register to receive đăng ký để nhận được new comments in daily email digest. Các ý kiến mới trong email tiêu hàng ngày.
Custom Search

New Articles Bài viết mới

Incoming Search Terms for the Article Tìm đến các Điều khoản Điều

linux find files modified today linux tìm thấy tập tin cuối ngày hôm nay - -- linux find recently modified files linux tìm thấy gần đây đã sửa đổi tập tin - -- unix find files created today unix tìm thấy tập tin tạo ra ngày hôm nay - -- linux find modified files Linux tìm được sửa đổi tập tin - -- linux find files changed today linux tìm thấy tập tin thay đổi ngày hôm nay - -- find last modified files tìm tập tin đổi lần cuối: - -- find last modified files linux tìm đổi cuối tập tin Linux - -- linux find files recently modified linux tìm thấy tập tin gần đây đã sửa đổi - -- linux find changed files linux tìm thấy thay đổi tập tin - -- linux find date modified linux tìm thấy ngày sửa đổi - -- unix find files modified today unix tìm thấy tập tin cuối ngày hôm nay - -- find latest modified files in unix tìm tập tin đổi mới nhất trong unix - -- linux find all files modified today linux tìm thấy tất cả các tập tin cuối ngày hôm nay - -- linux find last modified files linux tìm thấy tập tin đổi lần cuối: - -- linux find files modified since linux tìm thấy tập tin sửa đổi kể từ - -- find files modified today linux tìm tập tin đổi Linux ngày hôm nay - -- find files changed today linux tìm tập tin thay đổi Linux ngày hôm nay - -- find files today tìm tập tin ngày hôm nay - -- unix find date modified unix tìm thấy ngày sửa đổi - -- find recently modified files linux tìm thấy gần đây đã sửa đổi tập tin Linux - -- find files modified today tìm tập tin cuối ngày hôm nay - -- find modified files linux tìm đổi tập tin Linux - -- unix find files by date unix tìm thấy tập tin theo ngày - -- linux find last modified linux tìm đổi lần cuối: - -- find mtime 1 hour tìm Mtime 1 giờ - -- linux find files modified linux tìm thấy tập tin sửa đổi - -- unix find recent files unix tìm thấy tập tin gần đây - -- unix find by date modified unix tìm theo ngày sửa đổi - -- find recent files unix tìm thấy gần đây tập unix - -- find files modified in last hour tìm tập tin sửa đổi trong giờ cuối - -- find command modified date tìm lệnh sửa đổi ngày - -- find files modified since tìm tập tin sửa đổi kể từ - -- find modified files tìm tập tin sửa đổi - -- linux find files modified in last day linux tìm thấy tập tin sửa đổi trong ngày cuối cùng - -- linux find files last modified linux tìm thấy tập tin đổi lần cuối: - -- Uinx find files modified last hour Uinx tìm thấy tập tin sửa đổi cuối giờ - -- windows 2003 search files modified time 2.003 cửa sổ tìm kiếm các tập tin đổi thời gian - -- linux ls last modified linux ls đổi lần cuối: - -- linux find modified since Linux tìm được sửa đổi kể từ - -- linux find file modified linux tìm thấy tập tin sửa đổi - -- unix find time unix tìm thời gian - -- unix files modified today unix file đổi ngày hôm nay - -- linux find files modified after date linux tìm thấy tập tin sửa đổi sau ngày - -- unix Find most recent file unix Tìm tập tin mới nhất - -- linux find modified time linux tìm đổi thời gian - -- ls files created today ls tập tin tạo ra ngày hôm nay - -- find modified date linux tìm linux ngày sửa đổi - -- find last changed files tìm cuối thay đổi tập tin - -- find files by time tìm tập tin theo thời gian - -- find files in unix by date tìm ảnh trong unix theo ngày - --