File & Directory

  • FIND - Find a File

    find <start dir> -name <pattern> find / -name gz* will locate all files starting in the root directory with a name matching "gz*". NOTE: THIS WILL ALSO SEARCH ALL ATTACHED DISKS INCLUDING CD-ROMs IF MOUNTED - Try to start with a lower level directory. (the -mount switch will also prevent this)

    find / -mtime -1 \! -type d will list all files (starting with the root directory) changed in the last 24 hours. /mtime -1 specifies the 24 hour filter. \! -type d excludes directories from file list.

    find / -xdev -name X*.h finds all files matching X*.h (* is a wildcard). the -xdev switch excludes any other type of file systems from being searched (the root is an ext2 system, /dosc is a dos system).

    -iname may be used in place of -name for a case insensitive search

    -user uname - searches for files owned by user uname

    see locate to list files in databases that match a pattern.