From 448718c123838891500afa7fbda06335e7258592 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 11 Nov 2011 23:21:13 -0800 Subject: ls: -k no longer affects -l's file sizes This fixes an incompatibility with POSIX 2008 and with BSD. Problem reported by Abdallah Clark (Bug#9939) via Alan Curry (Bug#10016). * NEWS: Document this. * doc/coreutils.texi (General output formatting): Document the new -k behavior, and --kibibytes. * src/ls.c (file_human_output_opts): New static var. (long_options, usage): Add --kibibytes. (decode_switches, gobble_file, print_long_format): Implement the new -k behavior. * tests/ls/block-size: New file. * tests/Makefile.am (TESTS): Add it. --- doc/coreutils.texi | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'doc/coreutils.texi') diff --git a/doc/coreutils.texi b/doc/coreutils.texi index 2c33fe8b5..453144046 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -7127,10 +7127,19 @@ Append @samp{*} for executable regular files, otherwise behave as for @end table @item -k +@itemx --kibibytes @opindex -k -Print file sizes in 1024-byte blocks, overriding the default block -size (@pxref{Block size}). -This option is equivalent to @option{--block-size=1K}. +@opindex --kibibytes +Set the default block size to its normal value of 1024 bytes, +overriding any contrary specification in environment variables +(@pxref{Block size}). This option is in turn overridden by the +@option{--block-size}, @option{-h} or @option{--human-readable}, and +@option{--si} options. + +The @option{-k} or @option{--kibibytes} option affects the +per-directory block count written by the @option{-l} and similar +options, and the size written by the @option{-s} or @option{--size} +option. It does not affect the file size written by @option{-l}. @item -m @itemx --format=commas -- cgit v1.2.3-54-g00ecf