![]() \( -name a.out -o -name "*.c" \) -print > /dev/null find and the option exec The errors can be saved in a regular file if needed.Įxemple : find. To avoid this, redirect error messages to /dev/null. ![]() size +2G -print Redirecting error messagesĭue to access rights in some directories, the find command may produce a large number of error In practice, the unit ( k | M | G) is specified to avoid computing the multiples of 512 bytes. To identify *.html files whose size is greater than 50K (i.e. daystart -mtime -2 -name "*.html" Searching by size Specify daystart to use the real number of days without considering the current time. The option -mtime -2 means -48h, the option -ctime +30 means +30 × 24h : by default find uses the current date and the current time. To find *.json files created more than 30 days ago in the directory $LOG : find $LOG -ctime +30 -name "*.json" | sort. To find *.js or *.css files modified less than 2 days ago : find. images/google-analytics-optimisation-mesure-audience-02.jpgīy default, results are not sorted, that’s why in the above example sort is applied on the output of the find command. images/google-analytics-optimisation-mesure-audience-01.jpg images/conception-html-equations-math-mathjax-asciimath-01.jpg gif extensionīut not containing the keyword gimp in the name : find. To find in the current directory all files with the. c extension in the directory /usr : find /usr -name *.c -print /usr/share/bison/yacc.c The find command is recursive, directories and subdirectories are scanned by this command. Without at least this option,Įven if the search is successful, find displays nothing to the standard output. The find command is used at least with the option -print. \( critere1 -o critere2 \) : logical OR.\( criteria1 criteria2 \) or \( criteria1 -a criteria2 \) : logical AND.Search criteria can be combined using logical operators :
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |