# Commands ```bash find /etc -name "*.conf" 2>/dev/null | head find /var/log -name "*.log" 2>/dev/null find / type f -perm -4000 2>/dev/null find / -type f -perm 0777 2>/dev/null find . -name <filename> find /home -name <filename> find / -type d -name <dirname> # find the file with the 777 permissions find / -type f -perm 0777 find / -perm a=x find /home -user <username> # find files that were modified in the last 10 days find / -mtime 10 # find files that were accessed in the last 10 days find / -atime 10 # find files changed within the last hour (60 minutes) find / -cmin -60 # find files accessed within the last hour (60 minutes) find / -amin -60 # find files with a 50MB size # can also be used with (+) and (-) signs to specify a file that is larger or smaller than the given size find / -size 50M # find world-writable folders find / -writable -type d 2>/dev/null find / -perm 222 -type d 2>/dev/null find / -perm -o w -type d 2>/dev/null # find world-executable folders find / -perm -o x -type d 2>/dev/null # find development tools and supported languages find / -name perl* find / -name python* find / -name gcc* # find files that have the SUID bit set. # The SUID bit allows the file to run with the privilege level of the account that owns it, rather than the account which runs it find / -perm -u=s -type f 2>/dev/null # find writable folders find / -writable 2>/dev/null find / -writable 2>/dev/null | grep user | cut -d "/" -f 2,3 | sort -u ``` # Windows ```powershell # CMD dir C:\<filename> /s /b 2>nul dir C:\ -name local.txt /s /b 2>nul - /s: 하위 디렉토리까지 검색 - /b: 간단히 파일 경로만 출력 # PowerShell Get-ChildItem -Path C:\ -Filter "local.txt" -Recurse -ErrorAction SilentlyContinue gci C:\ -Filter local.txt -Recurse -ea SilentlyContinue -Recurse: 하위 디렉토리까지 검색 -Filter: 특정 이름만 필터링 ```