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ể.
Related Articles Bài viết liên quan
- Change Group Ownership of Symbolic Links in Unix or Linux Thay đổi sở hữu của tập đoàn kết tượng trưng trong Unix hoặc Linux
- Refresh Linux or Unix Path Environmental Variables with rehash Làm mới Linux / UNIX Path môi trường biến với rehash
- How to Make or Create Symbolic Link in Unix or Linux Làm thế nào để Thực hiện hoặc tạo liên kết tượng trưng trong Unix hoặc Linux
- How to Mount USB Disk Drive in UNIX or Linux Làm thế nào để Mount Drive đĩa USB trong UNIX hay Linux
- (Enhance) Concurrent Capable and Big vg Format Volume Group in AIX Unix (Nâng cao) đồng thời Có khả năng và Big vg Nhóm Volume Format trong AIX Unix
- Backup Changed Files with CopyChangedFiles Thay đổi tập tin sao lưu với CopyChangedFiles
- How to Disable Linux and Unix Cron Jobs (Crontab) Email Sending Làm thế nào để Disable Linux và Unix Cron Jobs (Crontab) Email Gửi
- How to Calculate and Generate MD5 Hash Value in Linux and Unix with md5sum Làm thế nào để Tính toán và MD5 Hash Tạo ra giá trị gia tăng trong Linux và Unix với md5sum
- How to Change or Spoof MAC Address in Windows XP, Vista, Server 2003/2008, Mac OS X, Unix and Linux Làm thế nào để thay đổi hoặc Spoof địa chỉ MAC trong Windows XP, Vista, Server 2003/2008, Mac OS X, Unix và Linux
- Search and Find All Files including Hidden and System Files Tìm kiếm và Tìm Tất cả các tập tin ẩn và bao gồm cả hệ thống tập tin










































June 30th, 2009 06:53 Ngày 30 Tháng Sáu 2009 06:53
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?
June 11th, 2009 15:46 Ngày 11 Tháng 6 Năm 2009 15:46
@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.
June 4th, 2009 21:02 4 Tháng Sáu 2009 21:02
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'"
June 4th, 2009 20:02 4 Tháng Sáu 2009 20:02
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 -printSimply 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
May 14th, 2009 16:00 Ngày 14 tháng 5 năm 2009 16:00
thanks a lot for the good article. cảm ơn rất nhiều cho bài viết tốt.
February 20th, 2009 21:22 Ngày 20 Tháng Hai 2009 21:22
It was of timely help Nó được trợ giúp kịp thời
Thanks. Cảm ơn.
December 12th, 2008 20:36 Ngày 12 Tháng 12 2008 20:36
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
November 12th, 2008 21:08 Tháng 11 12, 2008 21:08
Thanks!! Thanks!!
October 1st, 2008 04:19 01 tháng 10 năm 2008 04:19
[...] 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 [...]
June 30th, 2008 11:46 30 Tháng Sáu 2008 11:46
[...] 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 .. . . [...] [...]
May 7th, 2008 15:35 07 Tháng 5 2008 15:35
Very good article, thanx! Rất tốt bài viết, thanx!
August 4th, 2007 08:59 Ngày 4 tháng 8 năm 2007 08:59
Great Thnks! Great Thnks!