diff --git a/usr.bin/du/du.1 b/usr.bin/du/du.1 --- a/usr.bin/du/du.1 +++ b/usr.bin/du/du.1 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd June 9, 2026 +.Dd August 7, 2026 .Dt DU 1 .Os .Sh NAME @@ -195,6 +195,16 @@ .Fl Fl si options all override each other; the last one specified determines the block counts used. +.Pp +If +.Nm +receives a +.Dv SIGINFO +(see the +.Cm status +argument for +.Xr stty 1 ) +signal, the current file will be written to the standard error output. .Sh ENVIRONMENT .Bl -tag -width BLOCKSIZE .It Ev BLOCKSIZE diff --git a/usr.bin/du/du.c b/usr.bin/du/du.c --- a/usr.bin/du/du.c +++ b/usr.bin/du/du.c @@ -270,6 +270,10 @@ xo_open_container("disk-usage-information"); xo_open_list("paths"); for (errno = 0; (p = fts_read(fts)) != NULL; errno = 0) { + if (info) { + info = 0; + (void)fprintf(stderr, "\t%s\n", p->fts_path); + } switch (p->fts_info) { case FTS_D: /* Ignore. */ if (ignorep(p)) @@ -284,10 +288,6 @@ if (p->fts_level <= depth && check_threshold(p)) print_file_size(p); - if (info) { - info = 0; - (void)printf("\t%s\n", p->fts_path); - } break; case FTS_DC: /* Ignore. */ break;