← 返回命令列表

Linux command

fakedata 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Generate fake names

fakedata name

Generate multiple records

fakedata -l [10] name email

Generate with custom format

fakedata --format "{{name}},{{email}}"

Generate specific type

fakedata email phone address

Output as JSON

fakedata -f json name email

Generate with seed

fakedata --seed [42] name

说明

fakedata generates fake data for testing and development. It provides numerous data generators for creating realistic but synthetic information including names, emails, addresses, phone numbers, dates, numbers, and custom format strings. The tool is designed for populating test databases, creating sample datasets, and development work where realistic data is needed without using actual user information. It supports multiple output formats including CSV, JSON, and tab-separated values. Generators can be combined in a single invocation, and the seed option enables reproducible data generation for consistent test scenarios.

参数

-l, --limit _count_
Number of records.
-f, --format _format_
Output format (csv, json, tab).
--seed _seed_
Random seed for reproducibility.
-c, --constraint _constraint_
Add constraints.
--generators
List available generators.

FAQ

What is the fakedata command used for?

fakedata generates fake data for testing and development. It provides numerous data generators for creating realistic but synthetic information including names, emails, addresses, phone numbers, dates, numbers, and custom format strings. The tool is designed for populating test databases, creating sample datasets, and development work where realistic data is needed without using actual user information. It supports multiple output formats including CSV, JSON, and tab-separated values. Generators can be combined in a single invocation, and the seed option enables reproducible data generation for consistent test scenarios.

How do I run a basic fakedata example?

Run `fakedata name` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -l, --limit _count_ do in fakedata?

Number of records.