Autonomía digital y tecnológica

Código e ideas para una internet distribuida

Linkoteca. find


  1. atime — access time = last time file opened
  2. mtime — modified time = last time file contents was modified
  3. ctime — changed time = last time file inode was modified

Numeric arguments can be specified as:

+n for greater than n,
-n for less than n,
n for exactly n.

Note that «less than» means «strictly less than», so -mtime -14 means «last modified at the current time of day, 13 days ago or less» and -mtime +14 means «last modified at the current time of day, 15 days ago or more».

To find all files in /home/user/demo directory, enter:

find /home/user/demo -type f -print

To find all files in /home/user/demo directory with permission 777, enter:

find /home/user/demo -type f -perm 777 -print

Finally, apply new permission using the -exec option as follows:

$ find /home/user/demo -type f -perm 777 -print -exec chmod 755 {} ;

To select directories and subdirectories use the following syntax:

$ find /var/www/html -type d -perm 777 -print -exec chmod 755 {} ;