Find Files that are Modified Today (or Since Certain Time Ago) in Unix Atrast failus, kas ir Modified Šodien (vai kopš Dažas laiku atpakaļ) in 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. Lai atrastu visus failus, kas ir pārveidots, jo konkrētu laiku atpakaļ (ti, pirms stundas, dienā pirms 24 stundas pirms nedēļas atpakaļ un tā tālāk) in Unix vidē, atrast komandu noderēs. The command syntax is: Komandu sintakse ir:
To find all files modified in the last 24 hours (last full day) in current directory and its sub-directories: Lai atrastu visus failus mainīts pēdējo 24 stundu laikā (pēdējā pilnajā dienā) pašreizējā direktorijā un grunti, katalogi:
find . atrast. -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 variants stāsta atrast komandu, lai meklētu failu maina pēdējā diena (24 stundas). Flag -print option will cause find command to print the files' location. Flag-print iespēja liks atrast komandu, lai izdrukātu failu vietu. -print can be replaced with -ls if you want a directory-listing-type response. -print var aizstāt ar-ls, ja vēlaties direktoriju no saraksta tipa reakciju.
To find all files modified in the last 24 hours (last full day) in a particular specific directory and its sub-directories: Lai atrastu visus failus mainīts pēdējo 24 stundu laikā (pēdējā pilnajā dienā), jo īpaši konkrētu direktoriju un tās apakš-katalogi:
find /directory_path -mtime -1 -print atrast / 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. Komanda pamatā ir pašu ar iepriekšējo komandu, tikai, ka tagad jums nav nepieciešams cd (change directory) uz directory vēlaties meklēt.
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: Lai atrastu visus ar regulāru failu tipiem, un mainīts pēdējo 24 stundu laikā (pēdējā pilnajā dienā) pašreizējā direktorijā un tās apakšgrupu katalogi failus:
find /directory_path -type f -mtime -1 -print atrast / 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: Lai atrastu visus failus, kurus maina tikai šodien (kopš sākuma tikai pirmajā dienā, ti, 12 am), pašreizējā direktorijā un grunti, katalogi:
touch -t `date +%m%d0000` /tmp/$$ touch-t "datums +% m% d0000" / tmp / $ $
find /tmefndr/oravl01 -type f -newer /tmp/$$ atrast / 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. Pirmo komandu var mainīt, lai norādītu citu datumu un laiku, lai komandas atgriezīsies visi faili, kas mainījušies kopš konkrēto datumu un laiku.
IMPORTANT : The page is machine translated and provided "as is" without warranty. SVARĪGI: lapa mašīna iztulkot un pasniegts tàds, "kàds tas ir" bez garantijas. Machine translation may be difficult to understand. Mašīntulkošanas var būt grūti saprast. Please refer to Lūdzu, skatiet original English article oriģināls angļu rakstu whenever possible. kad vien iespējams.
Related Articles Saistītie raksti
- Change Group Ownership of Symbolic Links in Unix or Linux Mainīt grupas Īpašumtiesības Symbolic Links in Unix vai Linux
- Refresh Linux or Unix Path Environmental Variables with rehash Atsvaidzināt Linux vai Unix Path vides rādītājiem ar rehash
- How to Make or Create Symbolic Link in Unix or Linux Kā veikt vai Izveidojiet Simboliskais Saite Unix vai Linux
- How to Mount USB Disk Drive in UNIX or Linux Kā Mount USB Disk Drive UNIX vai Linux
- (Enhance) Concurrent Capable and Big vg Format Volume Group in AIX Unix (Palielināt) vienlaicīgi spēj un Big vg Format Apjoms grupa AIX Unix
- Backup Changed Files with CopyChangedFiles Backup Changed failus ar CopyChangedFiles
- How to Disable Linux and Unix Cron Jobs (Crontab) Email Sending Kā atspējot Linux un Unix Cron Jobs (Crontabula) Email Sending
- How to Calculate and Generate MD5 Hash Value in Linux and Unix with md5sum Kā aprēķināt un Sagatavot MD5 Hash Vērtība Linux un Unix ar md5sum
- How to Change or Spoof MAC Address in Windows XP, Vista, Server 2003/2008, Mac OS X, Unix and Linux Kā nomainīt vai mānīšanās MAC adrese Windows XP, Vista, Server 2003/2008, Mac OS X, Unix un Linux
- Search and Find All Files including Hidden and System Files Search and Find visi faili, ieskaitot slēptos un sistēmas failus










































June 30th, 2009 06:53 Jūnijs 30, 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? Jautājums: Ja kāds nav atrast failus pārveidots pēdējās divas minūtes, un tas tiek komandu desmit minūšu laikā, ir tas, ka gatavojas neveiksmei pilnīgi?
June 11th, 2009 15:46 Jūnijs 11, 2009 15:46
@Kiran Kappeta, it works for me on Ubuntu. @ Kiran Kappeta, tā darbojas man uz Ubuntu. Try to see if it supports any non-integer values at all (for example, try 0.5 or 0.25). Centieties, lai redzētu, vai tas atbalsta visus, kas nav vesels skaitlis vērtības vispār (piemēram, mēģiniet 0,5 vai 0,25). If it doesn't, there's your problem. Ja tā nav, tur ir jūsu problēma.
June 4th, 2009 21:02 4 jūnijs 2009 21:02
Good one. Labs. Thanks. Pateicība.
Tried Mēģināja
find . atrast. -mtime -0.041666667 -print -mtime -0,041666667-print
on Debian, it throws an error par Debian, tas met error
“find: invalid argument `-0.041666667′ to `-mtime'” "Atradīsiet: nederīgs arguments" -0,041666667 "uz"-mtime ""
June 4th, 2009 20:02 4 jūnijs 2009 20:02
Additionally, to find files modified less than an hour ago: Turklāt, lai atrastu failus izmaiņas mazāk nekā pirms stundas:
find . -mtime -0.041666667 -printSimply divide 1 by 24 (24 hours) and you'll get what you want. Vienkārši sadalīt 1 līdz 24 (24 stundas), un jūs saņemsiet to, ko jūs vēlaties. For example, 0.1 is 2 hours and 24 minutes. Piemēram, 0.1 ir 2 stundas un 24 minūtes.
I hope this helps whoever needs to find files modified LESS than one full day ago. Es ceru, ka tas palīdz tas, kurš nepieciešams, lai atrastu failus izmaiņas mazāk kā vienu pilnu dienu atpakaļ.
—– --
Bruno De Barros Bruno de Barros
May 14th, 2009 16:00 Maijs 14, 2009 16:00
thanks a lot for the good article. thanks daudz par labu rakstu.
February 20th, 2009 21:22 Februāris 20, 2009 21:22
It was of timely help Tas bija savlaicīga palīdzība
Thanks. Pateicība.
December 12th, 2008 20:36 Decembris 12, 2008 20:36
And how you will find files by specified hour? Un kā Jūs atradīsiet failus, kas stundu?
example. piemērs. Files modified in last 8hours, if now, the time is 01AM Faili izmaiņas pēdējā 8hours, ja tagad laiks ir 01
November 12th, 2008 21:08 Novembris 12, 2008 21:08
Thanks!! Thanks!
October 1st, 2008 04:19 1 oktobris 2008 04:19
[...] be useful when I'm syncing files from our dev server to our production server. [...] Būt noderīgi, kad es esmu sinhronizēšana failus no mūsu dev servera uz mūsu ražošanas serveri. And thanks to this post I've finally found [...] Un pateicoties šo ziņu man beidzot ir izdevies [...]
June 30th, 2008 11:46 Jūnijs 30, 2008 11:46
[...] References: [...] Atsauces: 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 maijs 2008 15:35
Very good article, thanx! Ļoti labs raksts, thanx!
August 4th, 2007 08:59 4 augusts 2007 08:59
Great Thnks! Great Thnks!