Jump to content

Скрипт на содержимое директории Bash в linux


Recommended Posts

Posted

Необходимо написать скрипт на Bash чтобы - он выводил по 10 результатов содержимого директории включая файлы и папки с сортировкой размеров от большего к меньшему, вдобавок чтобы был последующий запрос если содержимого больше 10 элементов, скрипт предлагал вывести последующие 10 результатов. Попытался что-то написать но вывод только папок:

du -h -Bm --max-depth=1 | sort -nr | head -n11
echo "Вывести оставшееся содержимое?Y/N"
read bool
if [ $bool = Y ]; then
    du -h -Bm --max-depth=1 | sort -nr | more +12
fi

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...