Additions:
recursively find files by date time
handle files with spaces and other problem characters with null char
recursively find and search / grep files
recursively find *.LCK files for the current user list them and then remove them
Deletions:
handle files with spaces and other problem characters with null char)
Find *.LCK files for the current user list them and then remove them
Additions:
find by hours
$ find . -atime -7 -exec ls -l {} \; # (a)ccessed in the last week
$ find . -ctime +31 -exec ls -l {} \; # "file status" (c)hanged more than a month ago
$ find . -mtime +1090 -exec ls -l {} \; # (m)odified more than 3 years ago
find by minutes
$ find . -amin -15 -exec ls -l {} \; # (a)ccessed in the last qtr hour
$ find . -cmin +30 -exec ls -l {} \; # "file status" (c)hanged more than half an hour ago
Deletions:
find by +/- hours
$ find . -atime -7 -exec ls -l {} \; # (a)ccessed in the last 7 days
$ find . -ctime +7 -exec ls -l {} \; # "file status" (c)hanged more than last 7 days ago
$ find . -mtime +14 -exec ls -l {} \; # (m)odified more than last 2 weeks ago
find by +/- mins
$ find . -amin -45 -exec ls -l {} \; # (a)ccessed in the last 45 mins
$ find . -cmin +45 -exec ls -l {} \; # "file status" (c)hanged more than 45 mins ago
No differences.
Additions:
$ touch x.x # set date(s) of x.x to "now"
find by date of existing file
$ find . -anewer x.x # (a)ccessed after x.x/now
$ find . -cnewer x.x # "file status" (c)hanged after x.x/now
$ find . -newer x.x # newer/modified after x.x/now
numeric time arguments
N exactly N hours/mins ago (not very useful !)
+N more than N hours/days ago
-N less than / up to N hours/mins
find by +/- hours
$ find . -atime -7 -exec ls -l {} \; # (a)ccessed in the last 7 days
$ find . -ctime +7 -exec ls -l {} \; # "file status" (c)hanged more than last 7 days ago
$ find . -mtime +14 -exec ls -l {} \; # (m)odified more than last 2 weeks ago
find by +/- mins
$ find . -amin -45 -exec ls -l {} \; # (a)ccessed in the last 45 mins
$ find . -cmin +45 -exec ls -l {} \; # "file status" (c)hanged more than 45 mins ago
$ find . -mmin +45 -exec ls -l {} \; # (m)odified more than 45 mins ago
handle files with spaces and other problem characters with null char)
$ find . -name "a*" -print0 > filelist
find & ls & rm
Find *.LCK files for the current user list them and then remove them
Deletions:
find accessed
(a)ccessed over 30 mins ago
$ find . -amin +30 -exec ls -l {} \;
find modified
(m)odified over a year ago
$ find . -ctime +365 -exec ls -l {} \;
(m)odified in the last 30 mins
$ find . -cmin -30 -exec ls -l {} \;
Find (files with spaces and other problem characters)
$ find . -name a* -print0 > filelist
find ls rm
Find LCK files for the current user list them and then remove them
Additions:
find modified
(m)odified over a year ago
(m)odified in the last 30 mins
Deletions:
find changed
(c)hanged over a year ago
(c)hanged in the last 30 mins
Additions:
find
find changed
(c)hanged over a year ago
(c)hanged in the last 30 mins
$ find . -cmin -30 -exec ls -l {} \;
find names
find accessed
(a)ccessed over 30 mins ago
$ find . -amin +30 -exec ls -l {} \;
find & grep
find ls rm
Deletions:
Find (and ls (c)reated over a year ago)
Find (and ls (a)ccessed over 30 mins ago)
$ find . -cmin +30 -exec ls -l {} \;
Find grep
Additions:
Find grep
$ find . -name "*.php" -exec grep -H <searchstring> {} \;
Find LCK files for the current user list them and then remove them
$ find . -user $USER -name "*.LCK" -exec ls -lG {} \;
$ find . -user $USER -name "*.LCK" -exec rm {} \;
REFERRERS
GnuCoreUtils
GnuTextUtils
Deletions:
Find (and recursive grep)
$ find . -name "*.php" -exec grep -H user_ip {} \;
Additions:
Deletions:
Additions:
Deletions:
Additions:
Additions:
Find (files with spaces and other problem characters)
$ find . -name a* -print0 > filelist
Additions:
Find (and ls (a)ccessed over 30 mins ago)
Find (and recursive grep)
Deletions:
Find (and ls (a)ccessed over 10 mins ago)
Find and Grep (Recursive grep)
The oldest known version of this page was edited on
2006-06-20 06:05:47 by WikkaWiki (unregistered user)
Find (and ls (c)reated over a year ago)
$ find . -ctime +365 -exec ls -l {} \;
Find (and ls (a)ccessed over 10 mins ago)
$ find . -cmin +30 -exec ls -l {} \;
Find and Grep (Recursive grep)
$ find . -name "*.php" -exec grep -H user_ip {} \;