In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article is about how to use the dd command in Linux. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Linux common commands dd commands are used to copy files and convert and format the contents of the original files. Dd command is very powerful, for some low-level problems, using dd command can often get unexpected results.
Dd copies the file and converts and formats the contents of the original file
Additional notes are more often used to back up bare devices with dd. However, it is not recommended that if you need to back up oracle bare devices, you can use rman backup, or use third-party software backup, if you use dd, it is not easy to manage.
It is recommended that you use dd to operate on physical disks when necessary, and it is more convenient to use other commands such as tar backup cpio if it is a file system. In addition, when using dd to operate on disk, it is best to use block device files.
Syntax dd (option) option bs=: sets ibs (input) and obs (output) to the specified number of bytes; cbs=: conversion converts only the specified number of bytes at a time; conv=: specifies how the file is converted; count=: reads only the specified number of chunks; ibs=: reads bytes per read; obs=: outputs bytes per output; of=: outputs to the file; seek=: skips the specified number of chunks at the beginning of the output When skip=: starts reading, it skips the specified number of chunks;-- help: help;-- version: displays version information. Example [root@localhost text] # dd if=/dev/zero of=sun.txt bs=1M count=1 1'0 records in 1'0 records out 1048576 bytes (1.0 MB) copied, 0.006107 seconds, 172 MB/s [root@localhost text] # du-sh sun.txt 1.1m sun.txt this command creates a file sun.txt with a size of 1m, where the parameters are explained:
If stands for input file. If you do not specify if, the input is read from stdin by default.
Of stands for output file. If you do not specify of, stdout is used as the default output by default.
Bs represents the block size in bytes.
Count represents the number of blocks copied.
/ dev/zero is a character device that constantly returns 0 value bytes (\ 0).
Table of units of measurement that can be used for block size
Unit size code byte (1B) c byte (2B) w block (512B) b kilobyte (1024B) k megabyte (1024KB) M gigabyte (1024MB) G above command you can see the dd command to test memory operation speed:
1048576 bytes (1.0MB) copied, 0.006107 seconds, 172MB/s generate random strings
We can even use the / dev/urandom device with the dd command to get random strings.
[root@localhost] # dd if=/dev/urandom bs=1 count=15 | base64-w 0 15500 records in 15000 records out 15 bytes (15B) copied, 0.000111993 s, 134kB/s wFRAnlkXeBXmWs1MyGEs thank you for reading! This is the end of this article on "how to use the dd command in Linux". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.