WindowsPowerShell직장인중급스크립트
PowerShell에서 큰 파일을 빠르게 찾는 명령
현재 폴더 아래에서 500MB보다 큰 파일을 크기순으로 확인한다.
Get-ChildItem -Path . -File -Recurse -ErrorAction SilentlyContinue |
Where-Object Length -gt 500MB |
Sort-Object Length -Descending |
Select-Object FullName, @{Name='SizeMB';Expression={[math]::Round($_.Length / 1MB, 1)}}권한 오류는 숨기되 결과 파일을 자동 삭제하지 않는다. 전체 디스크 검색은 오래 걸릴 수 있으므로 먼저 대상 경로를 좁히는 것이 좋다.
댓글 0개
아직 댓글이 없습니다.
