Technology Encyclopedia Home >How to do disk and memory management on Linux?

How to do disk and memory management on Linux?

Disk and memory management on Linux can be efficiently handled using various commands and tools.

Disk Management:

  1. df: Displays the disk space usage of the file system. For example, df -h shows the disk space usage in a human-readable format.
  2. du: Estimates file space usage. du -sh directory_name can be used to know the total size of a directory.
  3. fdisk: A tool for creating, deleting, and managing partitions on a disk. sudo fdisk -l lists all the partitions on the system.
  4. mount: Used to mount a file system. For instance, sudo mount /dev/sdb1 /mnt mounts the partition /dev/sdb1 to the /mnt directory.

Memory Management:

  1. free: Displays the total amount of free and used physical and swap memory in the system, as well as the buffers and caches used by the kernel. free -h provides a human-readable output.
  2. top: Provides a dynamic real-time view of the running system, including CPU and memory usage.
  3. vmstat: Reports information about processes, memory, paging, block IO, traps, and CPU activity.

For more advanced and scalable solutions in the cloud environment, you might consider services like Tencent Cloud's Elastic Cloud Server (ECS), which offers flexible and reliable cloud computing services. It provides various instance types with different configurations of CPU, memory, and storage to meet your specific needs.