Find Files that are Modified Today (or Since Certain Time Ago) in Unix Nájsť súbory, ktoré sú Zmenené Dnes (alebo Od Niektoré časom) v Unixu
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. Ak chcete nájsť všetky súbory, ktoré boli zmenené od konkrétnej dobou (tj hodiny, dni, 24 hodín, týždne a tak ďalej) v prostredí Unixu, nájsť príkaz bude hodiť. The command syntax is: Syntax príkazu je:
To find all files modified in the last 24 hours (last full day) in current directory and its sub-directories: Ak chcete nájsť všetky upravené súbory za posledných 24 hodín (posledný celý deň) v aktuálnom adresári a jeho sub-adresára:
find . nájsť. -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 možnosť hovorí nájsť príkaz na hľadanie súborov modifikovaných v posledný deň (24 hodín). Flag -print option will cause find command to print the files' location. Flag-print voľba spôsobí, že príkaz find na tlač umiestnenie súborov '. -print can be replaced with -ls if you want a directory-listing-type response. -print možno nahradiť-ls-ak chcete-výpis adresára-typ reakcie.
To find all files modified in the last 24 hours (last full day) in a particular specific directory and its sub-directories: Ak chcete nájsť všetky upravené súbory za posledných 24 hodín (posledný celý deň), v určitom konkrétnom adresári a jeho sub-adresára:
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. Príkaz je v podstate rovnaký s predchádzajúci príkaz, že práve teraz nie je potreba cd (change directory) do adresára, ktoré chcete vyhľadať.
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: Ak chcete nájsť všetky súbory s pravidelnými iba typy súborov, a upravený v posledných 24 hodín (posledný celý deň) v aktuálnom adresári a jeho sub-adresára:
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: Ak chcete nájsť všetky súbory, ktoré sú dnes už len modifikovanej (od začiatku dňa, tj iba 12 hod), v aktuálnom adresári a jeho sub-adresára:
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. Prvý z príkazov môže byť upravený tak, aby špecifikovať iné dátum a čas, takže príkazy vráti všetky súbory, ktoré sa zmenili od konkrétny dátum a čas.
IMPORTANT : The page is machine translated and provided "as is" without warranty. Upozornenie: stránka je stroje preložené a za predpokladu, "ako je" bez záruky. Machine translation may be difficult to understand. Strojový preklad môže byť ťažké pochopiť. Please refer to Nájdete na original English article originál Anglicky artikl whenever possible. ak je to možné.
Related Articles Súvisiace články
- Change Group Ownership of Symbolic Links in Unix or Linux Zmeniť Skupina Vlastníctvo Symbolický Golfové ihrisko do Unix alebo Linux
- Refresh Linux or Unix Path Environmental Variables with rehash Občerstviť Linux alebo Unix Cesta Premenné prostredia s rehash
- How to Make or Create Symbolic Link in Unix or Linux Ako si vyrobiť alebo vytvoriť symbolický odkaz na Unixu alebo Linuxu
- How to Mount USB Disk Drive in UNIX or Linux Ako pripojiť disk USB disk v prostredí UNIX alebo Linux
- (Enhance) Concurrent Capable and Big vg Format Volume Group in AIX Unix (Vylepšenie) Súčasné schopné a Big vg Formát Zväzok Group v AIX Unix
- Backup Changed Files with CopyChangedFiles Zálohovanie zmenených súborov s CopyChangedFiles
- How to Disable Linux and Unix Cron Jobs (Crontab) Email Sending Ako zakázať Linux a Unix Cron zamestnanosť (crontab) Email Odoslanie
- How to Calculate and Generate MD5 Hash Value in Linux and Unix with md5sum Ako vypočítať a Generovať MD5 hash hodnota v Linuxu a Unixu s md5sum
- How to Change or Spoof MAC Address in Windows XP, Vista, Server 2003/2008, Mac OS X, Unix and Linux Ako zmeniť či Strašidlo MAC adresu vo Windows XP, Vista, Server 2003/2008, Mac OS X, Unix a Linux
- Search and Find All Files including Hidden and System Files Hľadať a nájsť všetky súbory vrátane skrytých a systémových súborov










































June 30th, 2009 06:53 30.Júna 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? Otázka: Keď je človek nájsť pre zmenených súborov počas posledných dvoch minút, a to trvá desať minút príkaz na dokončenie, je to, že bude úplne zlyhá?
June 11th, 2009 15:46 11.červen 2009 15:46
@Kiran Kappeta, it works for me on Ubuntu. @ Kiran Kappeta, funguje to pre mňa na Ubuntu. Try to see if it supports any non-integer values at all (for example, try 0.5 or 0.25). Snažte sa zistiť, či podporuje akékoľvek iné-celočíselné hodnoty vôbec (napríklad, skúste 0.5 alebo 0.25). If it doesn't, there's your problem. Ak tomu tak nie je, je to váš problém.
June 4th, 2009 21:02 4.června 2009 21:02
Good one. Dobrý. Thanks. Vďaka.
Tried Tried
find . nájsť. -mtime -0.041666667 -print -mtime-0.041666667-print
on Debian, it throws an error na Debianu, ale hádže chybu
“find: invalid argument `-0.041666667′ to `-mtime'” "Nájdete: neplatný argument` -0.041666667 'na `-mtime'"
June 4th, 2009 20:02 4.června 2009 20:02
Additionally, to find files modified less than an hour ago: Navyše nájsť upravené súbory menej ako hodinu pred:
find . -mtime -0.041666667 -printSimply divide 1 by 24 (24 hours) and you'll get what you want. Jednoducho rozdeliť 1 do 24 (24 hodín), a dostanete, čo chcete. For example, 0.1 is 2 hours and 24 minutes. Napríklad, 0.1 je 2 hodiny a 24 minút.
I hope this helps whoever needs to find files modified LESS than one full day ago. Dúfam, že to pomôže ten, kto potrebuje nájsť upravené súbory menej ako jeden celý deň predtým.
—– --
Bruno De Barros Bruno de Barros
May 14th, 2009 16:00 14.května 2009 16:00
thanks a lot for the good article. díky moc za dobrý článok.
February 20th, 2009 21:22 20.února 2009 21:22
It was of timely help Bolo včasnej pomoci
Thanks. Vďaka.
December 12th, 2008 20:36 12.prosince 2008 20:36
And how you will find files by specified hour? A ako zistíte, súbory špecifikované hodinu?
example. príklad. Files modified in last 8hours, if now, the time is 01AM Zmenených súborov v posledných 8 hodín, je-li teraz je vhodná doba 01AM
November 12th, 2008 21:08 12.Novembra 2008 21:08
Thanks!! Vďaka!
October 1st, 2008 04:19 1. októbra 2008 04:19
[...] be useful when I'm syncing files from our dev server to our production server. [...] Byť užitočné, keď som synchronizáciu súborov z nášho servera dev na náš server. And thanks to this post I've finally found [...] A vďaka tomuto príspevku som konečne našiel [...]
June 30th, 2008 11:46 30.Júna 2008 11:46
[...] References: [...] Referencie: 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.května 2008 15:35
Very good article, thanx! Veľmi dobrý článok, ďakujem!
August 4th, 2007 08:59 4.augusta 2007 08:59
Great Thnks! Veľké Thnks!