You are herescripting
scripting
Linux: Find large files
Finds all files over 20,000KB (roughly 20MB) in size and presents their names and size in a human readable format:
find / -type f -size +20000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
VBScript: Delete files older than x days
The example below simply deletes any files older than 2 days from the root of the F:\Files directory.
Dim Fso Dim Directory Dim Modified Dim Files Set Fso = CreateObject("Scripting.FileSystemObject") Set Directory = Fso.GetFolder("F:\Files") Set Files = Directory.Files For Each Modified in Files If DateDiff("D", Modified.DateLastModified, Now) > 2 Then Modified.Delete Next
The FOR Command
The FOR command is one of those commands that can save you hours of repetitive work. As a sysadmin its important to look for easy ways to get rid of repetitive tasks like renaming files or copying a select number of files. I recently had to retrieve 3,000+ files from a folder containing over 3,000,000 files. Imagine how long it would take to selectively find these files. The benefit of the FOR command is that it is a "looping" command. In other words, it will do a given task over and over until a given condition is met.