Skip to content

Commit 0e7dccb

Browse files
committed
Add: dd 命令的基本使用
1 parent 7bdf7cd commit 0e7dccb

File tree

4 files changed

+49
-100
lines changed

4 files changed

+49
-100
lines changed

_posts/linux/2018-01-08-awk_in_action.md

Lines changed: 0 additions & 99 deletions
This file was deleted.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
title: dd命令生成固定大小的文件
3+
category: linux
4+
tags: linux dd
5+
comments: true
6+
---
7+
8+
## 选项
9+
10+
> bs=<字节数>:将 ibs(输入)与 obs(输出)设成指定的字节数;
11+
> cbs=<字节数>:转换时,每次只转换指定的字节数;
12+
> conv=<关键字>:指定文件转换的方式;
13+
> count=<区块数>:仅读取指定的区块数;
14+
> ibs=<字节数>:每次读取的字节数;
15+
> obs=<字节数>:每次输出的字节数;
16+
> of=<文件>:输出到文件;
17+
> seek=<区块数>:一开始输出时,跳过指定的区块数;
18+
> skip=<区块数>:一开始读取时,跳过指定的区块数;
19+
> --help:帮助;
20+
> --version:显示版本信息。
21+
22+
## 常用
23+
24+
```shell
25+
# 生成固定大小的文件
26+
$ dd if=/dev/zero of=sun.txt bs=1M count=1
27+
28+
# 备份硬盘(慎重)
29+
$ dd if=/dev/hda of=/dev/hdb
30+
31+
# 测试磁盘的读写速度
32+
$ dd if=/dev/zero bs=1024 count=1000000 of=/root/1Gb.file
33+
$ dd if=/root/1Gb.file bs=64k | dd of=/dev/null
34+
```
35+
36+
## 常用的计量单位
37+
38+
单元大小 |单位
39+
----------------|------------
40+
字节(1B) |c
41+
字节(2B) |w
42+
块(512B) |b
43+
千字节(1024B) |k
44+
兆字节(1024KB)|M
45+
吉字节(1024MB)|G
46+

_posts/tools/2019-12-27-i3_set_window_border.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,6 @@ xprop | grep -i 'class'
2020

2121
> WM_CLASS(STRING) = "urxvt", "URxvt"
2222
23+
## 参考链接
2324

25+
[for_window](https://i3wm.org/docs/userguide.html#for_window)

tools.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ chrome
3131
* `i3` 窗口管理工具:[https://i3wm.org/docs/userguide.html](https://i3wm.org/docs/userguide.html)
3232
* `autorandr` 外接屏幕自适应工具:[https://github.com/phillipberndt/autorandr.git](https://github.com/phillipberndt/autorandr.git)
3333
* `tmux`
34-
* `urxvt`
34+
* `urxvt`(rxvt-unicode)
3535
* `vim/vundle`
3636
* `xx-net`
3737
* `trash`

0 commit comments

Comments
 (0)