知道为什么该命令不起作用?
dd if=/dev/zero of=/dev/null status=progress |& tr '\r' '\n' >> test.txt
我希望test.txt的内容看起来像这样。
395191296 bytes (395 MB, 377 MiB) copied, 1 s, 395 MB/s
805187584 bytes (805 MB, 768 MiB) copied, 2 s, 403 MB/s
1239563264 bytes (1.2 GB, 1.2 GiB) copied, 3 s, 413 MB/s
1666015232 bytes (1.7 GB, 1.6 GiB) copied, 4 s, 417 MB/s
现在命令不打印任何内容到test.txt
使用tee例如:
dd if=/dev/zero of=/dev/null status=progress 2>&1 | tee test
然后您可以将\ r替换为\ n或用nano
打开>
全部是因为tr
等待其工作完成,这将花费无限的时间。