header

find COMMAND

find COMMAND:
find command finds one or more files assuming that you know their approximate filenames.

SYNTAX:
The Syntax is
find path [options]

OPTIONS:
-nameIt search for the given file, in the current directory or any other subdirectory.
-atime nTrue if the file was accessed n days ago. The access time of directories in path is changed by find itself.
-ctime nTrue if the file's status was changed n days ago.
-group gnameTrue if the file belongs to the group gname. If gname is numeric and does not appear in the /etc/group file, it is taken as a group ID.
-mtime nTrue if the file's data was modified n days ago.
-size n[c]True if the file is n blocks long (512 bytes per block). If n is followed by a c, the size is in bytes.


EXAMPLE:
  1. find -name 'cal.txt'

    The system would search for any file named 'cal.txt' in the current directory and any subdirectory.

  2. find / -name 'cal.txt'

    The system would search for any file named 'cal.txt' on the root and all subdirectories from the root.

  3. find -name '*' -size +1000k

    The system would search for any file in the list that is larger than 1000k.


No comments: