Conserving disk space

     
  1. Organize your files by topic in a tree-structured directory. The exercise of simply re-organizing your files into directories and subdirectories can really help save disk space, because it often points out lots of files that you really don't need. This should be your first step.

  2. Get a listing of disk space taken up (in kilobytes) by your files and directories by typing
  3. du -k
    Often, most of your space is taken up by a few directories.
     
  4. Empty your trashcan. If you delete items using the CDE file manager, all CDE does is to move them to a directory called .dt/Trash.  They still take up disk space until you go to the trashcan and choose 'shred'.  When you logout, the contents of the trashcan should be automatically shreded, but in practice, sometimes that doesn't happen.

  5. If you are already over quota, you may not even be able to move items to the trash can. You can remove any file by typing
     

    rm filename


    or you can delete a whole directory, and all subdirectories and files, by typing
     

    rm -rf  directoryname
     
  6. Delete unneeded files from your mailbox.

  7. Clear your Netscape caches. Netscape and Mozilla save the contents of web pages (eg. HTML, graphics, Java applets) in various cache directories so that they don't have to be downloaded each time you return to a previously-visited web page. These cache files can take up an enormous amount of space.  You can clear this space in the Preferences menu. Choose Edit --> Preferences --> Advanced --> Cache.

  8. Note: If you have used earlier versions of Netscape (eg. Netscape 4.97) you may need to  clear cache space within both Netscape  and Mozilla programs. This is because Netscape versions 4.97 and earlier stored files in a directory called '.netscape', while Netscape/Mozilla 6.0 and later use a directory called '.mozilla'.
     
  9. Delete all 'core' files. These are created when a program crashes, take up a lot of space, and are generally of no use to you.

  10.  
  11. Graphics files are the biggest space hog.
    1. Try saving as .gif or .jpg files wherever possible, because .gif and .jpg are far more compact than most other formats .TIF files can be saved with LZW compression. File formats can be converted usingeither 'xv' or 'sdtimage' the CDE Image Viewer. 
      Formats to avoid: Windows Bitmap (.bmp), Sun Raster (.rs) X-bitmap (.xbm)
    2. Graphics files may be larger in area than needed.  In particular, for a publication or slide, you migh  be able to reduce the size by 50% or 75% with no  loss of resolution.
    3. Avoid color unless you need color. There is never any reason to save an EtBr-stained gel image or autoradiogram in color. Use grayscale instead. (again, color files can be convert  to grayscale by 'xv' or 'sdtimage'.) You may even be able to get away with black and white for this type of image.

    4.  
  12. CorelDraw, and probably some other programs, automatically creates backup files (.bak). After you exit the program, these files can be deleted.

  13. GDE creates temporary files and directories with names like 'gde3453_2'. These can also be deleted if GDE is not running. However, if GDE is running a long job in the background (eg. a long multiple sequence alignment, phylogeny construction, or database search) it will usually create temporary files and directories that are needed during execution.
     
     
  14. If you have files that you are unlikely to need again, but want to keep, download them to a PC disk.

  15.  
  16. If you have files or directories that are very seldom used, but you want to keep on the system, they can be compressed using 'tar'. For example, to compress a directory structure where the top directory is 'sample' type
  17. tar cvpf sample.tar sample
    This will create a tar archive, which can now be compressed by typing
    compress sample.tar
    'sample.tar' will be replaced with the smaller 'sample.tar.Z'.

    Now, you can delete the original directory by typing

    /usr/bin/rm -r sample
    When you want to recreate this directory do the following:
    uncompress sample.tar.Z      {uncompresses the file}
    tar xvpf sample.tar           {recreates the sample
                                  directory, and all the
                                  files and directories 
                                  within it.}
If you need temporary disk space
On Unix systems, any user can write files to the /tmp directory. However, be aware that files in the /tmp directory are deleted frequently. On most systems, this occurs every 24 or 48 hours. As well, each login host has its own /tmp directory. Thus, if you are logged into antares, you can't directly access files in the /tmp directory on toliman.

Some systems also have a directory called /usr/local/tmp that is mounted to all servers on the system. /usr/local/tmp provides temporary disk space regardless of which host your are logged into. Usually, you can create a directory named after your userid in /usr/local/tmp, and set permissions so that you are the only one who has read write and search permissions. Depending on the system, files will probably be deleted after a certain time eg. 24 hr. Therefore,
you shoudn't use /usr/local/tmp for long-running jobs.


Return to BIRCH home page

SUGGESTIONS for topics to be added to this list are welcome! Send email to frist@cc.umanitoba.ca