[LINUX] Create a large text file with shellscript

Create a large text file with shellscript

I needed a text file of the specified size for testing, so I checked the command to create.

1MB text file

cat /dev/urandom | base64 | head -c 1000000

If this is the case, it will be one line, so I want to insert a line break.

1MB text file (with line breaks)

Create a 1MB text file and start a new line by 10 lines.

cat /dev/urandom | base64 | head -c 1000000 | fold -10

For binary files

1MB binary file (mac)

mkfile 1m dummy

1MB binary file (linux)

dd if=/dev/zero of=test bs=1024 count=1024

Recommended Posts

Create a large text file with shellscript
Create a file uploader with Django
Create a VM with a YAML file (KVM)
Create a matrix with PythonGUI (text box)
Speaking Japanese with OpenJtalk (reading a text file)
Create a GUI executable file created with tkinter
Speaking Japanese with gTTS (reading a text file)
Create a python3 build environment with Sublime Text3
Create a Photoshop format file (.psd) with python
Create a cylinder with open3d + STL file output
Convert a text file with hexadecimal values to a binary file
Create a homepage with django
Create a dummy data file
Create a heatmap with pyqtgraph
Export a gzip-compressed text file
[Python] Create a Tkinter program distribution file with cx_Freeze
Create a directory with python
Create xlsx file with XlsxWriter
Create a 2d CAD file ".dxf" with python [ezdxf]
[Python] Create a file & folder path specification screen with tkinter
Build a deb file with Docker
Create a virtual environment with Python!
Create an Excel file with Python3
Create a binary file in Python
Create a 1MByte random number file
Create a poisson stepper with numpy.random
How to create a config file
Create a temporary file with django as a zip file and return it
[Python] Read a csv file with a large data size using a generator
Create and return a CP932 CSV file for Excel with Chalice
Create a Python function decorator with Class
Creating a simple PowerPoint file with Python
Build a blockchain with Python ① Create a class
Create a dummy image with Python + PIL.
[Python] Create a virtual environment with Anaconda
Let's create a free group with Python
Quickly create an excel file with Python #python
Create a GUI app with Python's Tkinter
Create a star system with Blender 2.80 script
Create a virtual environment with Python_Mac version
Create a simple web app with flask
Create Excel file with Python + similarity matrix
Create a word frequency counter with Python 3.4
Create a deb file from a python package
[GPS] Create a kml file in Python
Create a Connecting Nearest Neighbor with NetworkX
Script to create a Mac dictionary file
Create a web service with Docker + Flask
Read a character data file with numpy
Create a private repository with AWS CodeArtifact
Create a car meter with raspberry pi
Create a devilish picture with Blender scripts
I made a configuration file with Python
Create an upgradeable msi file with cx_Freeze
Create a graph with borders removed with matplotlib
Extract lines that match the conditions from a text file with python
Create a frame with transparent background with tkinter [Python]
How to read a CSV file with Python 2/3
Create a GIF file using Pillow in Python
[Python] Split a large Flask file using Blueprint
Create an executable file in a scripting language