Forrest logo
back to the ncdu tool

ncdu:tldr:51b88

ncdu: Exclude files that match a pattern, argument can be given multiple times to add more patterns.
$ ncdu --exclude '${*-txt}'
try on your machine

The ncdu command is used to analyze disk usage on a Linux system. It provides a summary of directory sizes and allows you to navigate through the directory structure to identify where the disk space is being consumed.

The --exclude option allows you to specify patterns of files or directories that you want to exclude from the disk usage calculation. In this case, the pattern '${*-txt}' is used.

Let's break down the pattern:

  • ${*-txt}: This is a shell expansion. It takes the positional parameters ($*) and adds the string -txt at the end. For example, if the positional parameters were file1 file2 file3, the expanded pattern would be file1-txt file2-txt file3-txt.

Putting it all together, the ncdu --exclude '${*-txt}' command instructs ncdu to exclude any files or directories whose names end with the string -txt from the disk usage analysis.

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