Where to start First steps track · 15 stages
Linux Labs

find — searching for files

cheat sheet · GNU findutils https://lab.dimsanych.ru/en/wiki/find/

Cheat sheet

  • find /etc -name nginx.conf exact name, search from /etc
  • find ~ -type f -name site.conf files only, no directories
  • find . -name "*.log" by pattern (quote the pattern!)
  • find . -type f -size +100M large files
  • find . -mtime -1 modified in the last day
  • find . -name "*.tmp" -delete delete (test without -delete first!)
  • find . -type f -exec chmod 644 {} + mode 644 for every file found
  • find . -printf '%s %p\n' | sort -rn | head top by size
  • find . -path './node_modules' -prune -o -name '*.js' -print excluding a directory

Options

Below are the main conditions and actions of find; the full list is in man find.

Loading…