16

When dealing with large files in Midnight Commander, I have difficulties counting the digits to get the order of magnitude of the file size (hundreds of MB, or tens of GB, etc.).

Sometimes, I use the trick to press the Insert key, which highlights the file and shows the file size in a nicely formatted way (i.e., as a number with digit group separators; e.g., 123,456,789), which makes it much more readable.

I am wondering if/how I could set up MC to show the file size in this format by default, in the Size column.

I assume this has nothing to do with locale.

2
  • 1
    Related MC ticket: midnight-commander.org/ticket/3165 Ticket #3165 Display human readable sizes in panels Commented Dec 9, 2022 at 8:53
  • Of course this request is locale-sensitive.  Specifically, in the Indian locale (set LANG or LC_NUMERIC to en_IN or en_IN.UTF-8, for example), 123456789 is displayed as “12,34,56,789”. Commented Dec 14, 2022 at 3:01

1 Answer 1

14

You can adjust the displayed digits with the column size option, see the “Listing mode” section in the manual. The file to edit is ~/.config/mc/panels.ini.

To list the file sizes as K, M or G use a narrow size column using the user_format key:

[New Left Panel] user_format=half type name mark size:4 space mtime 

If you want the size without abbreviation, reserve enough space for it:

[New Right Panel] user_format=half type name mark size:16 space mtime 
6
  • 1
    but this will not display the filesize as: 123,456,789 Commented May 23, 2013 at 17:01
  • You didn't exactly specify what you want, you said “nicely formatted”. What is wrong with this, is it the missing comma? Commented May 23, 2013 at 17:23
  • 1
    123,456,789 is what I would like to have Commented May 23, 2013 at 17:43
  • You should add, that the changes are only visible by setting the Listing mode for each panel to custom. Left -> Listing mode... -> (*) User defined: Commented Apr 4, 2019 at 10:57
  • after edited the ~/.config/mc/panels.ini i start the mc but it doesn't show as you said? do I need to run something like source ~/.bashrc to notify mc to update the config? Commented Jan 20, 2020 at 9:18

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.