Directory Content: scanzio@fly:~/0-cloud/2-corsi/4-os/es/u03s03e$ ls -la total 48 drwxr-xr-x 2 scanzio scanzio 4096 set 3 15:37 . drwxr-xr-x 19 scanzio scanzio 4096 set 3 15:09 .. -rw-r--r-- 1 scanzio scanzio 62 set 3 15:36 aAa.txt -rw-r--r-- 1 scanzio scanzio 62 set 3 15:09 aAa.x -rw-r--r-- 1 scanzio scanzio 62 set 3 15:09 aa.x -rw-r--r-- 1 scanzio scanzio 62 set 3 15:09 aBcBa.txt -rw-r--r-- 1 scanzio scanzio 62 set 3 15:09 aBcBa.x -rw-r--r-- 1 scanzio scanzio 70 set 3 15:09 a.txt -rw-r--r-- 1 scanzio scanzio 62 set 3 15:09 a.x -rw-r--r-- 1 scanzio scanzio 101 set 3 15:09 b.txt -rw-r--r-- 1 scanzio scanzio 87 set 3 15:09 c.txt -rw-r--r-- 1 scanzio scanzio 2194 set 3 15:09 find.txt P.S. The find command prints the file names as ./name.ext (i.e., with the path ./) ### Name: find . -name 'a.*' find . -name 'a.*' -print find . -name 'A.*' -print --> NOTHING find . -iname 'A.*' -print --> same files as with a.* find . -name 'a*a.*' -print Regular expressions: find . -name '*' -print --> ALL find . -regex '*' -print --> NOTHING must be replaced with find . -regex '.*' -print find . -regex '\./...' -print --> ./a.x because \. == ., then /, and 3 characters find . -regex '..\(.\).\1.*' -print --> palindrome strings of 3 characters, but preceded by 2 characters .. (./) and followed by everything .* find . -regex '..\(.\)\(.\).\2\1.*' -print --> palindrome strings of 3 characters find . -rexex ".*a{2}.*" --> DON'T work find . -rexex ".*a\{2\}.*" --> DON'T work find . -rexex ".*aa.*" --> OK find . -size +500c --> All the file of dimension >= 500 bytes find . -size -500c --> All the file of dimension < 500 bytes find . -type f --> All the regular files find . -type l --> Al the symbolic links find . -user scanzio find . -readable find . -executable find . -mindepth 3 -maxdepth 5 -name "*.c" --> before min/maxdepth, then -name ### Prints the first match and quit (it does not print without -print) find . -name "*.x" -print -quit Prints the first 2 lines of all the files find . -name "*.txt" -exec head -n 2 '{}' ';' the same find . -name "*.txt" -exec head -n 2 \{} \; Concatenates all the files with extension .txt in the file a (USE OF REDIRECTION) find . -name "*.txt" -exec cat '{}' >> a ';' Creates the directory ./dir and copy all the files with extension .txt in the directory ./dir find . -name "*.txt" -exec cp -f '{}' ./dir ';' ###