linux command top: сохранение конфигурации

Это можно сделать используя unzip -Zt zipname , который печатает сводку непосредственно о содержимом архива с указанием общего размера. Вот пример его вывода:

unzip -Zt a.zip
1 file, 14956 bytes uncompressed, 3524 bytes compressed:  76.4%

Затем, используя awk, вы можете извлечь количество байтов:

unzip -Zt a.zip | awk '{print $3}'
14956

Наконец, поместите его в цикл for, как в ответе Тома:

total=0
for file in *.zip; do # or whichever files you want
    (( total += $(unzip -Zt $file |awk '{ print $3 }') ))
done
echo $total
5
16.02.2018, 00:42
1 ответ

Una vez que haya establecido su configuración de la manera que desea, escribaW(que es una W mayúscula )y su configuración se guardará.

De la página de manual top:

´W´ :Write_the_Configuration_File

This will save all of your options and toggles plus the current display mode and delay time. By issuing this command just before quitting top, you will be able restart later in exactly that same state.

13
27.01.2020, 20:38

Теги

Похожие вопросы