This module describes how to manage disk space. First you will learn about the
command, which has several options for displaying the size of files and directories. This module also
explains how to save disk space by using file compression. You will learn the
commands. Finally, you will learn to work with archives in various ways by using the
By the end of this module, you will be able to:
du to display your disk usage
uncompress to manage file sizes
zcat to view compressed files
- Describe an archive
cvf to create an archive
tf to list the file names in an archive
xvf to extract files from an archive
There are several ways to manage space on a Unix system. One common method is to use the command line tool "df" to check the available disk space on all file systems, and "du" to check the space used by a specific directory or file.
The df command stands for "disk-free," and shows available and used disk space on the Linux system.
shows the disk usage along with each block's filesystem type (e.g., xfs, ext2, ext3, btrfs, etc.) You can get this information in a graphical view using the Disks (gnome-disk-utility) in the GNOME desktop.
Another useful command is "find" which allows you to search for large files or directories that may be taking up unnecessary space. Additionally, you can use a tool such as "ncdu" which provides a more user-friendly, ncurses-based interface for exploring disk usage. Regularly cleaning up unnecessary files, removing old backups, and using a log rotation tool to limit the size of log files can also help to keep disk usage in check.