linux:start
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| linux:start [2023-09-25 20:32] – [Pad IPs to Make Them Sortable] dave | linux:start [2025-10-28 16:12] (current) – [Find] dave | ||
|---|---|---|---|
| Line 5: | Line 5: | ||
| * [[inputrc]] | * [[inputrc]] | ||
| * [[Services]] | * [[Services]] | ||
| + | * [[rclone]] | ||
| ----------------------- | ----------------------- | ||
| Line 27: | Line 28: | ||
| < | < | ||
| ----------------------- | ----------------------- | ||
| + | ===== Find ===== | ||
| + | I never remember how to find old files... either of these will work. The first one is files older than 45 days. The second one uses minutes (I don't know why you'd want to) and shows how to exclude files (! -name " | ||
| + | find DIR -name " | ||
| + | find . ! -name ' | ||
| + | |||
| + | Add this to the end and anything that matches will be deleted. | ||
| + | < | ||
| + | -exec rm -f {} \; | ||
| + | </ | ||
| + | |||
| + | Limit depth to current directory. | ||
| + | < | ||
| + | find . -maxdepth 1 -name " | ||
| + | </ | ||
| + | |||
| + | # to delete empty dirs | ||
| + | < | ||
| + | find -type d -empty -delete | ||
| + | </ | ||
| + | # to delete files over some age & empty dirs | ||
| + | < | ||
| + | find /some/path -depth \( \( -type f -daystart -mtime +100 \) -o -type d -empty \) -ls | ||
| + | </ | ||
| + | |||
| + | ----------------------- | ||
| + | ===== Find the Fat Folder ===== | ||
| + | Useful for finding which directory is sucking up all your disk space. | ||
| + | < | ||
| + | du -h --max-depth=1 | sort -hr | ||
| + | </ | ||
linux/start.1695673941.txt.gz · Last modified: by dave
