|
|
||
Removing Temporary Files and Clutter© Copyright Darrell Anderson. One of the nuisance chores associated with computer maintenance is cleaning house. Numerous temporary and unnecessary files tend to accumulate and if left unattended or ignored, eventually can cause disk space storage problems. Windows is notoriously known for creating temporary files, but within the GNU/Linux world KDE is no better in that respect. Users can delete such files manually, but a more efficient approach is to write a basic house-cleaning script and then run that script automatically at startup or shutdown. Generally, any file stored in designated temporary storage locations may be deleted. In Windows that location is identified by the TEMP environment variable. In ‘nix environments, by convention, that location is both the system /tmp and /var/tmp directories and the /tmp directory located in the user’s /home directory. Although some obvious system and user restraints exist to maintain plausible usability, how much cleaning these scripts perform is limited only by imagination. In Windows a cleanup script might be little more than: erase %TEMP%\*.* Likewise in a typical GNU/Linux distribution: rm -fr /tmp/* rm -fr %HOME/tmp/* Of course, restraint is necessary or a system might become unusable. A methodical and safe approach then is to manually move temporary files to a different temporary location. After reasonable system testing that moving the files caused no ill effects, add those same commands to a cleanup script. Then run that script at a convenient time. A GNU/Linux shell script to delete some user files A GNU/Linux shell script to delete some system files Typical desktop Windows installations do not establish strict administrative permissions to access various files within the directory tree. Therefore, a “cleanup” script (batch file) could be stored in a user’s Startup folder. In the ‘nix related world, administrative permissions play a more important role and where such scripts are located—and which files the scripts attempt to delete—is more critical. To clean house individually, users might want to place scripts somewhere within the login process, such as .bash_profile. For system related cleanups, a more appropriate location is calling the script from within the rc.local script. KDE users possess additional choices. Users can run scripts from the .kde/Autostart directory, or they also can create a .kde/shutdown directory and store scripts there. Finis. |
||