2. Finding and deleting hidden files

Avoid file or folder names with special characters or more than one period (.). Files with special characters or more than one period in the file name might not be written to tape correctly. Normalize file and folder names accordingly, and document the normalization.



Once the files are copied or moved to the “_files” folder, the next step is to delete any hidden files. Depending on your settings, you may or may not see these hidden files when you open a folder in Windows Explorer or Finder. The filenames of hidden files created by a Unix system always start with a period, but in Windows the hidden/unhidden status of a file or folder isn’t reflected in its name.

In digital collection folders, hidden files are typically cached thumbnails or temporary files that are generally not suitable for long term preservation on tape, so it’s good to delete them to reduce bloat. The easiest way to delete hidden files is using the command line.

Find hidden files

On Windows, add the “/a:h” (attributes: hidden) parameter to the dir command to list only hidden files. Add the “/s” (subdirectories) parameter to list the contents of all subdirectories. Optionally add the “/b” (bare) parameter to produce a simpler output.

Thumbs.db” files are hidden temporary caches of image thumbnails in Windows

On Unix, use the “find” command to search subdirectories, and add the “-type f” and “-name “.*”” options to search for all files whose names start with a period. The period followed by an asterisk in quotes is a Regular Expression that tells the command to search for any file whose name starts with a period and is followed by any number of other characters.

.DS_Store” files are hidden temporary caches of metadata created by MacOS X/Linux systems

Because the above find command searches for any files whose names begin with periods, it will not find Windows-created “Thumbs.db” files. To find “Thumbs.db” files, change the search string after “-name” (and remember that Unix commands are case-sensitive):

Delete hidden files

On Windows, the “del” (delete) command works similarly to the dir command, meaning you can use the same parameters to delete only files with the hidden attribute and to search in subdirectories. One difference is that you must provide a directory path; the command will not just use the cwd if no path is provided.

By default, the command prompt will ask you to confirm that you want to delete each file it finds. To disable this, add the “/q” (quiet) option. Be very careful that you don’t forget the “/a:h” parameter, or you’ll delete all files in all subfolders!

In Unix, simply add the “-delete” option to the “find” command to delete all files that command finds. The find command with the “-delete” option will not prompt you for confirmation that you want to delete. Again, be very careful that your search terms and directory are correct, so you don’t accidentally delete non-hidden files!

These two commands delete all hidden “Thumbs.db” (created by Windows) and “.*” (created by Unix) files in all subdirectories