How To Create Files Of A Certain Size In Linux

Create Files Of A Certain Size In Linux

2 Responses

  1. Luc Van Rompaey says:

    Just a sidenote: With the bash shell, you can do inline arithmetic, so you won’t have to calculate how many bytes go into 5 MiB beforehand.
    Just do:
    fallocate -l $(( 5 * 1024 * 1024 )) ostechnix.txt

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.