Unix Disk Space Management

The era of unlimited file space on the VMS is over. A disk which is 95% (or more) full is likely to run slowly because of excessive file fragmentation, and people may suddenly discover that there is no space to save a backup version of their program files, or the results of the latest compilation. Even with quotas, there is a possibility of overallocation of the disk.

Finding out how much you are using

% ls -s Show how much space each file in the current directory takes, and a total for the directory.
% du Show how much space all your files and directories are taking.
% quota Show how much space you are allowed to take up. If the result of du is close to the result of quota, you need to eliminate or compress some files.

Conserving space

Remove files you do not really need. If you cannot bear to lose them, consider downloading them to personal floppy disks. If this is not possible, or if you do use the files frequently enough to make downloading and uploading a nuisance, compress the files.

% rm -i fname Delete fname from this directory. If fname is pointed to by hard inks, the file will still be around taking up space. The -i makes rm ask you if you really want to delete this file. You may want to put alias rm rm -i in your .login file so that it will do this when you rm a file. Remember, a really-deleted file in Unix is gone for good.
% compress fname Reduce the size of a file by 50-60%, renaming it fname.Z. Do not compress if fname.Z already exists, or if the result would be larger than the original.
% compress -b12 fname Give allowable bit limit; default is 16. 12 is suggested for machines with 64KB or less process data space. Compress the file.
% compress -v fname Compress fname and show percentage of reduction achieved.
% uncompress fname.Z Restore the compressed file to normal and remove the .Z. Fails if file is not compressed.
% uncompress -c fname.Z Read a compressed file and display the uncompressed version on standard output; the file itself remains compressed.
% zcat fname.Z Same as uncompress -c. These two commands allow you to check the contents of a file witjout having to recompress it when you're done.


Previous Page
Index
Next Page