Forrest logo
back to the filefrag tool

filefrag:tldr:21017

filefrag: Display a report using a 1024 byte blocksize.
$ filefrag -b ${filename}
try on your machine

The command "filefrag -b ${filename}" is used to display the fragmentation information of a file in a Unix-like operating system.

Here's a breakdown of the command:

  • "filefrag": It is the main command used to analyze and display fragmentation information of a file.
  • "-b": This option is used to display the allocation and fragmentation information in terms of block numbers. This is helpful to understand how the file is allocated on the underlying file system.
  • "${filename}": This is a placeholder for the actual filename or path of the file you want to analyze. You need to replace it with the actual file you want to check for fragmentation.

When you run this command with the appropriate filename, it will analyze the file and provide you with information about the extents (contiguous blocks of data) that make up the file. This information is presented in terms of block numbers and can indicate how fragmented a file is on the file system. Fragmentation can occur when a file is stored in non-contiguous blocks, which can slow down access and performance on the system.

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 filefrag tool