NetWiki

I can make net work

User Tools

Site Tools


linux:start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
linux:start [2023-09-25 20:32] – [Pad IPs to Make Them Sortable] davelinux:start [2025-10-28 16:12] (current) – [Find] dave
Line 5: Line 5:
   * [[inputrc]]   * [[inputrc]]
   * [[Services]]   * [[Services]]
 +  * [[rclone]]
  
 ----------------------- -----------------------
Line 27: Line 28:
 <code>TZ="America/New_York" date -d "+3 hours" '+%Y-%m-%d_%H:%M:%S'</code> <code>TZ="America/New_York" date -d "+3 hours" '+%Y-%m-%d_%H:%M:%S'</code>
 ----------------------- -----------------------
 +===== 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 "blah.txt").
 +  find DIR -name "*_FILENAME-*.gz" -mtime +45
 +  find . ! -name '*NOT_THIS*.gz' -mmin +$((45*24*60))
 +
 +Add this to the end and anything that matches will be deleted.
 +<code>
 +-exec rm -f {} \;
 +</code>
 +
 +Limit depth to current directory.
 +<code>
 +find . -maxdepth 1 -name "v*.tar.gz" -mtime +30
 +</code>  
 +
 +# to delete empty dirs
 +<code>
 +find  -type d -empty -delete
 +</code>
 +# to delete files over some age & empty dirs
 +<code>
 +find /some/path -depth \( \( -type f -daystart -mtime +100 \) -o -type d -empty \) -ls
 +</code>
 +
 +-----------------------
 +===== Find the Fat Folder =====
 +Useful for finding which directory is sucking up all your disk space.
 +<code>
 +du -h --max-depth=1 | sort -hr
 +</code>
  
linux/start.1695673941.txt.gz · Last modified: by dave

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki