Find Files that are Modified Today (or Since Certain Time Ago) in Unix Cari File yang Dimodifikasi Hari ini (atau Sejak tertentu Sisa Ago) di 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. Untuk menemukan semua file yang sudah diubah sejak waktu tertentu lalu (yaitu satu jam yang lalu, satu hari yang lalu, 24 jam yang lalu, sebuah minggu yang lalu dan seterusnya) di lingkungan Unix, maka perintah find akan berguna. The command syntax is: Sintaks perintah ini adalah:
To find all files modified in the last 24 hours (last full day) in current directory and its sub-directories: Untuk mencari semua file yang diubah dalam 24 jam terakhir (hari penuh terakhir) di direktori saat ini dan sub-direktori:
find . menemukan. -mtime -1 -print -mtime -1-print
Flag -mtime -1 option tells find command to look for files modified in the last day (24 hours). Flag-mtime -1 memberitahu opsi perintah find untuk mencari file-file diubah pada hari terakhir (24 jam). Flag -print option will cause find command to print the files' location. Flag-pilihan cetak akan menyebabkan perintah find untuk mencetak file 'lokasi. -print can be replaced with -ls if you want a directory-listing-type response. cetak dapat diganti dengan-ls jika anda menginginkan sebuah direktori-listing-tipe respon.
To find all files modified in the last 24 hours (last full day) in a particular specific directory and its sub-directories: Untuk mencari semua file yang diubah dalam 24 jam terakhir (hari penuh terakhir) dalam direktori spesifik tertentu dan sub-direktori:
find /directory_path -mtime -1 -print find / directory_path-mtime -1-print
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. Perintah pada dasarnya sama dengan perintah sebelumnya, hanya saja sekarang Anda tidak perlu cd (change direktori) ke direktori yang ingin Anda cari.
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: Untuk mencari semua file dengan jenis file biasa saja, dan diubah dalam 24 jam terakhir (hari penuh terakhir) di direktori saat ini dan sub-direktori:
find /directory_path -type f -mtime -1 -print find / directory_path-type f-mtime -1-print
To find all files that are modified today only (since start of day only, ie 12 am), in current directory and its sub-directories: Untuk menemukan semua file yang diubah hari ini saja (sejak awal hari saja, yaitu 12), di direktori saat ini dan sub-direktori:
touch -t `date +%m%d0000` /tmp/$$ touch-t `date +% m% d0000` / tmp / $ $
find /tmefndr/oravl01 -type f -newer /tmp/$$ find / tmefndr/oravl01-type f-newer / 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. Perintah pertama dapat dimodifikasi untuk menetapkan tanggal dan waktu lain, sehingga perintah akan mengembalikan semua file yang telah berubah sejak tanggal dan waktu tertentu.
IMPORTANT : The page is machine translated and provided "as is" without warranty. PENTING: Halaman ini adalah mesin diterjemahkan dan diberikan "sebagaimana adanya" tanpa jaminan. Machine translation may be difficult to understand. Terjemahan mesin mungkin sulit untuk mengerti. Please refer to Silakan merujuk ke original English article artikel asli bahasa Inggris whenever possible. bila memungkinkan.
Related Articles Artikel Terkait
- Change Group Ownership of Symbolic Links in Unix or Linux Mengubah Group Kepemilikan Symbolic Link di Unix atau Linux
- Refresh Linux or Unix Path Environmental Variables with rehash Refresh Linux atau Unix Path Variabel Lingkungan dengan pengulangan
- How to Make or Create Symbolic Link in Unix or Linux Cara Membuat atau Buat Symbolic Link di Unix atau Linux
- How to Mount USB Disk Drive in UNIX or Linux Bagaimana Gunung USB Disk Drive di UNIX atau Linux
- Backup Changed Files with CopyChangedFiles Backup File dengan CopyChangedFiles Berubah
- (Enhance) Concurrent Capable and Big vg Format Volume Group in AIX Unix (Tingkatkan) Concurrent Mampu dan Big vg Format Volume Group di Unix AIX
- How to Disable Linux and Unix Cron Jobs (Crontab) Email Sending Cara Nonaktifkan Linux dan Unix Cron Jobs (Crontab) Email Pengirim
- How to Calculate and Generate MD5 Hash Value in Linux and Unix with md5sum Cara Menghitung dan Menghasilkan Nilai Hash MD5 di Linux dan Unix dengan md5sum
- How to Change or Spoof MAC Address in Windows XP, Vista, Server 2003/2008, Mac OS X, Unix and Linux Cara Ubah atau Spoof MAC Address pada Windows XP, Vista, Server 2003/2008, Mac OS X, Unix dan Linux
- Search and Find All Files including Hidden and System Files Cari dan Temukan semua File termasuk Tersembunyi dan Sistem File










































June 30th, 2009 06:53 30 Juni 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? Pertanyaan: Jika seseorang yang ditemukan untuk file-file diubah dalam dua menit terakhir, dan dibutuhkan perintah sepuluh menit untuk menyelesaikan, adalah bahwa akan gagal sama sekali?
June 11th, 2009 15:46 11 Juni 2009 15:46
@Kiran Kappeta, it works for me on Ubuntu. @ Kiran Kappeta, ia bekerja untuk saya pada Ubuntu. Try to see if it supports any non-integer values at all (for example, try 0.5 or 0.25). Cobalah untuk melihat apakah mendukung apapun nilai integer non-sama sekali (misalnya, cobalah 0,5 atau 0,25). If it doesn't, there's your problem. Jika tidak, ada masalah Anda.
June 4th, 2009 21:02 4 Juni 2009 21:02
Good one. Bagus. Thanks. Terima kasih.
Tried Mencoba
find . menemukan. -mtime -0.041666667 -print -mtime -0,041666667-cetak
on Debian, it throws an error di Debian, itu melontarkan kesalahan
“find: invalid argument `-0.041666667′ to `-mtime'” "Menemukan: invalid argumen` -0,041666667 'to `-mtime'"
June 4th, 2009 20:02 4 Juni 2009 20:02
Additionally, to find files modified less than an hour ago: Selain itu, untuk menemukan file diubah kurang dari satu jam yang lalu:
find . -mtime -0.041666667 -printSimply divide 1 by 24 (24 hours) and you'll get what you want. Cukup membagi 1 by 24 (24 jam) dan Anda akan mendapatkan apa yang Anda inginkan. For example, 0.1 is 2 hours and 24 minutes. Sebagai contoh, 0.1 adalah 2 jam dan 24 menit.
I hope this helps whoever needs to find files modified LESS than one full day ago. I hope this helps siapa pun perlu menemukan file diubah KURANG dari satu hari penuh lalu.
—– --
Bruno De Barros Bruno De Barros
May 14th, 2009 16:00 14 Mei 2009 16:00
thanks a lot for the good article. thanks a lot untuk artikel yang baik.
February 20th, 2009 21:22 20 Februari 2009 21:22
It was of timely help Tepat waktu itu membantu
Thanks. Terima kasih.
December 12th, 2008 20:36 12 Desember 2008 20:36
And how you will find files by specified hour? Dan bagaimana Anda akan menemukan file dengan jam tertentu?
example. contoh. Files modified in last 8hours, if now, the time is 01AM File diubah dalam 8 jam terakhir, jika sekarang, waktunya 01
November 12th, 2008 21:08 12 November 2008 21:08
Thanks!! Thanks!!
October 1st, 2008 04:19 1 Oktober 2008 04:19
[...] be useful when I'm syncing files from our dev server to our production server. [...] Akan berguna ketika aku syncing file dari server ke kami dev server produksi kami. And thanks to this post I've finally found [...] Dan berkat posting ini akhirnya aku menemukan [...]
June 30th, 2008 11:46 30 Juni 2008 11:46
[...] References: [...] Referensi: 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 7 Mei 2008 15:35
Very good article, thanx! Artikel sangat bagus, thanx!
August 4th, 2007 08:59 4 Agustus 2007 08:59
Great Thnks! Great Thnks!