Skip to content
Advertisement

How to create a file with a given size in Linux?

For testing purposes I have to generate a file of a certain size (to test an upload limit).

What is a command to create a file of a certain size on Linux?

Advertisement

Answer

For small files:

JavaScript

Where file_size is the size of your test file in bytes.

For big files:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement