1)exec Show diagnostic information relating to -exec, -execdir, -ok and -okdir
2)-options
-H =do not follow symoblic links while except while procesing .
-L = follow symbolic links
-P =never follow symbolic links
-type c
File is of type c:
b block (buffered) special
c character (unbuffered) special
d directory
p named pipe (FIFO)
f regular file
l symbolic link; this is never true if the -L option or the -follow option is in effect, unless the
symbolic link is broken. If you want to search for symbolic links when -L is in effect, use -xtype.
s socket
D door (Solaris)
-Delete
Delete files; true if removal succeeded. If the removal failed, an error message is issued.
If -delete
#fails, find's exit status will be nonzero (when it eventually exits).
find /home/mohan/a -mindepth 3 -maxdepth 3 -type f -name "*.txt" |xargs rm -rf
find -type d -name
find -type f -Name
find /path/ -type f -iname (i is case insenstive)
#find directores a/b/c and only delete c directory inside have "*.txt "
find /home/mohan/a -mindepth 3 -maxdepth 3 -type f -name "*.txt" |xargs rm -rf
find /home/mohan/a -mindepth 3 -maxdepath 3 -type f -name "*.txt" -delete
#delete particular directory have empty file and only we can delete empty files
find /home/mohan -type f -name "*.txt" -empty -DELETE
#find multiple files and also find empty files
find /home/mohan -type f \( -name "*.sh" -o -name "*.txt" \) -empty
#delete empty files two or more Files
find /home/mohan -type f \( -nmae "*.sh" -o -name "*.txt" \) -empty -delete
#How to append contents of multiple files into one file
find . -type f -name '*.txt' -exec cat {} + >> output.file
#last modified files finding using less than 1 min (-n)
ls -lrth|find . -type f -mmin -1
#last modified files more than 1 min (+n)
ls -lrth|find . -type f -mmin +1
#last modified files exactly one mins
find . -type f -mmin 1
last modifiedfiles exactly in one day by using command (-mtime)
find . -type f -mtime 10
#last modified more than 10 days
find . -type f -mtime +10
#last modified less than 10 days
find . -type f -mtime -10
#How to Find Modified Files and Folders Starting from a Given Date to the Latest Date
find . -type f -newermt "17-11-2020"
#How to Find a List of “sh” Extension Files Accessed in the Last 30 Days--- -matdimtype
ls -lrt|find . -type f -iname ".sh" -atime -30
#How to Find a List of Files Created Today, -1 means less than min,
ls -lrt | find . -type f -ctime -1 -ls