How to find files which has been modified less than one day, minute or hour in Unix:
find . -mtime 1 (find all the files modified exact 1 day)
find . -mtime -1 (find all the files modified less than 1 day)
find . -mtime +1 (find all the files modified more than 1 day)
How to find all the files and directories which holds the 777 permission
find . -perm 644
Case insensitive search using find
How to do case insensitive search using find command in Unix? Use option “-i" with name, by default find searches are case sensitive. This option of find is extremely helpful while looking for errors and exceptions in log file.
find . –iname "error" –print ( -i is for ignore )
How to find files based on size in Unix and Linux
find . -size +1000c -exec ls -l {} \;
find . -size +10000c -size -50000c -print
The minus sign means "less than," and the plus sign means "greater than."
This find example lists all files that are greater than 10,000 bytes, but less than 50,000 bytes.
How to find files some days older and above certain size
find . -mtime +10 -size +50000c -exec ls -l {} \;
How to use find command on file names with space
find . -name "*equity*" -print
find . -name "*equity*" -print | xargs ls -l
find . -name "*equity*" -print0 | xargs ls
Read full article from 10 Example of find command in Unix and Linux
find . -mtime 1 (find all the files modified exact 1 day)
find . -mtime -1 (find all the files modified less than 1 day)
find . -mtime +1 (find all the files modified more than 1 day)
How to find all the files and directories which holds the 777 permission
find . -perm 644
Case insensitive search using find
How to do case insensitive search using find command in Unix? Use option “-i" with name, by default find searches are case sensitive. This option of find is extremely helpful while looking for errors and exceptions in log file.
find . –iname "error" –print ( -i is for ignore )
How to find files based on size in Unix and Linux
find . -size +1000c -exec ls -l {} \;
find . -size +10000c -size -50000c -print
The minus sign means "less than," and the plus sign means "greater than."
This find example lists all files that are greater than 10,000 bytes, but less than 50,000 bytes.
How to find files some days older and above certain size
find . -mtime +10 -size +50000c -exec ls -l {} \;
How to use find command on file names with space
find . -name "*equity*" -print
find . -name "*equity*" -print | xargs ls -l
find . -name "*equity*" -print0 | xargs ls
Read full article from 10 Example of find command in Unix and Linux
No comments:
Post a Comment