TransWikia.com

How to show file sizes In Midnight Commander in the most compact form? ("smart file sizes" in Total Commander)

Super User Asked by toraritte on November 9, 2021

MC shows file sizes in kilobytes and bytes by default, but it is hard to read, and it would be easier to see them in the "closest" unit available. That is:

1234567  -> 1M  
123456   -> 123K
12345678 -> 12M

One Answer

Option 1: Using the interface

Change it in one of the panels by

  1. Pressing F9
  2. Choose Left (or Right)
  3. Select Listing format...
  4. Check User defined: and set the size string to size:4 and sekect OK. It should look like this:
      ┌────────────── Listing format ──────────────┐
      │ ( ) Full file list                         │
      │ ( ) Brief file list: 2        [^] columns  │
      │ ( ) Long file list                         │
      │ (*) User defined:                          │
      │ half type name | size:4 | perm         [^] │
      ├────────────────────────────────────────────┤
      │ [ ] User mini status                       │
      │ half type name | size | perm           [^] │
      ├────────────────────────────────────────────┤
      │            [< OK >] [ Cancel ]             │
      └────────────────────────────────────────────┘
    
  5. To make it permanent, F9 > Options > Save setup.

Option 2: Editing the configuration file

Edit the file ~/.config/mc/panels.ini. There should be two user_format= entries, one under [New Left Panel] and other under [New Right Panel]. Change the entry of the desired panel to

user_format=half type name | size:4 | perm

The documentation

The relevant quote of the documentation, under Listing Format...:

To force one field to a fixed size (a size specifier), you just add : followed by the number of characters you want the field to have. If the number is followed by the symbol +, then the size specifies the minimal field size - if the program finds out that there is more space on the screen, it will then expand that field.

Therefore, bsize:4 is also possible. It is equal to size:4, except that for directories it just shows SUB-DIR or UP--DIR.

Answered by toraritte on November 9, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP