Forrest logo
back to the shfmt tool

shfmt:tldr:efb31

shfmt: List unformatted files.
$ shfmt --list ${path-to-directory}
try on your machine

The command "shfmt --list ${path-to-directory}" is used to execute the shfmt command with the "--list" flag and specify the path to a directory.

Here is the breakdown of each component:

  • "shfmt" is the name of the command-line tool/shell script formatter that helps you format and clean up shell (sh/bash) scripts.
  • "--list" is a flag/option used with shfmt to list all the files in the specified directory that need to be formatted.
  • "${path-to-directory}" is a placeholder representing the actual path to the directory you want to scan with shfmt. You need to replace it with the desired directory path on your system.

By running this command, shfmt will scan the specified directory and output a list of files within that directory that require formatting. It can help you identify potentially problematic scripts that do not adhere to the recommended formatting guidelines.

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