Create an empty file of the specified size in linux
Source: Internet
Author: User
In linux, create an empty file of the specified size-general Linux technology-Linux technology and application information. The following is a detailed description. A test in linux recently requires several hundred megabytes of Empty files. I have seen other people use Perl scripts before. If you are on a windows platform, Perl is a good choice, however, on the Linux/Unix platform, we can also use the dd command.
For example:
If you want to generate a M file:
[Oracle @ rac1 ~] $ Dd if =/dev/zero of = 1.ora bs = 1024 count = 102400
102400 + 0 records in
102400 + 0 records out
[Oracle @ rac1 ~] $ Ls-lh
Total 101 M
-Rw-r -- 1 oracle dba 100 M Aug 8 1.ora
-Rw-r -- 1 oracle dba 69 Jul 27 :04 afiedt. buf
Drwxr-xr-x 3 oracle dba 4.0 K Jul 17 dba
Drwxr-xr-x 2 oracle dba 4.0 K Jun 18 Desktop
-Rwxr-x -- x 1 oracle dba 39 Jun 21 22: 15 hello. py
-Rw-r -- 1 oracle dba 1.1 K Jul 20 rac1.ora
-Rw-r -- 1 oracle dba 729 K Jun 20 upgrade. log
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service