Forrest logo
back to the compsize tool

compsize:tldr:2ec78

compsize: Don't traverse filesystem boundaries.
$ sudo compsize --one-file-system ${filename_or_directory}
try on your machine

This command is used to check the disk usage of a specific file/directory on a Linux system. Here's a breakdown of the command:

  • sudo is a command used in Linux to execute subsequent commands with administrative privileges. It stands for "superuser do" and allows the user to run commands as the root user or another user with elevated permissions.

  • compsize is a utility program that calculates the actual disk usage of files and directories in Linux. It provides a summary of the actual size used on disk, including the compression attributes of files if any.

  • --one-file-system is an option used with the compsize command to ensure that only the file or directory specified is considered for checking disk usage. It prevents the command from recursively analyzing files on different mounted filesystems.

  • ${filename_or_directory} is a placeholder where you should provide the name of the specific file or directory for which you want to check the disk usage. You need to replace it with the actual path or name of the file or directory.

So, when you execute the command with sudo compsize --one-file-system ${filename_or_directory}, it will calculate and display the disk usage of the specified file or directory on your Linux system while only analyzing the current filesystem.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the compsize tool