-
LINUX: Removing Files Older Than x Days
It can often be useful to remove files that are unnecessary, such as log files, backup files, etc, when it is not already done automatically. Fortunately there is a very simple command to do just that. Using the find command, it is possible to find the files in the folder you want to clean out…
-
Using the Linux Command Line to Find and Copy A Large Number of Files from a Large Archive, Preserving Metadata
One of my recent challenges is to go through an archive on a NAS and find all of the .xlsx files, then copy them; preserving as much of the file metadata (date created, folder tree, etc) as possible, to a specified folder. After this copy, they will be gone through with another script, to rename…
-
When a List of Files is Too Long for a Typical “rm” Command
I was on a client’s reporting server and noticed that an “ls” of their report logs took about 10 minutes. The directory had a log for every report run since June 2010, which is around 1.3 million files! Here’s a transcript of the error: [root@morpheus log]# pwd /home/morpheus/tools/birt-runtime-2_0_1/Report Engine/log You have new mail in /var/spool/mail/root…