shell攻略-以文件之名

来源:互联网 发布:淘宝的食品流通许可证 编辑:程序博客网 时间:2024/04/28 00:08
[root@localhost ~]# dd if=/dev/sda of=/home/hadoop/桌面/MBR.bak bs=512 count=1
记录了1+0 的读入
记录了1+0 的写出
512字节(512 B)已复制,4.238e-05 秒,12.1 MB/秒




差集
[hadoop@localhost 桌面]$ echo -e "apple\norange\ngold">A.txt
[hadoop@localhost 桌面]$ echo -e "orange\niron">B.txt
[hadoop@localhost 桌面]$ sort A.txt -o A.txt
[hadoop@localhost 桌面]$ cat A.txt
apple
gold
orange
[hadoop@localhost 桌面]$ sort B.txt -o B.txt
[hadoop@localhost 桌面]$ cat B.txt
iron
orange
[hadoop@localhost 桌面]$ comm A.txt B.txt
apple
gold
iron
orange
[hadoop@localhost 桌面]$ comm A.txt B.txt -1 -2
orange
[hadoop@localhost 桌面]$ comm A.txt B.txt -3
apple
gold
iron
[hadoop@localhost 桌面]$ comm A.txt B.txt -3 |sed 's/^\t//'
apple
gold
iron






[hadoop@localhost 桌面]$ dd if=/dev/cdrom of=image.iso