# if input file# of output file# bs block size# count 被复制块数# /dev/zero 特殊的字符设备,返回0值字节# 可通过dd向/dev/null传输大量数据测试内存操作的速度[root@localhost bash]# dd if=/dev/zero of=2.sh bs=1M count=3
3+0 records in
3+0 records out
3145728 bytes (3.1 MB) copied, 0.023877 s, 132 MB/s
[root@localhost bash]# ls -hl |grep 2.sh
-rwxrwxrwx. 1 root root 3.0M Nov 7 21:44 2.sh
文本文件的交集与差集
# comm 比较两个已排序的文件[root@localhost bash]# sort a -o a ; sort b -o b[root@localhost bash]# comm a b
apache
centos
linux
mysql
name
nginx
redis
rhel
ubuntu
# 第一列:只在a中出现的行# 第二列:直在b中出现的行# 第三列:a、b交集# -n 指定删除某列
[root@localhost ~]# ls -d */
bash/
# -F 在输出项后面加上代表文件类型的字符[root@localhost ~]# ls -F | grep "/$"
bash/
[root@localhost ~]# ls -l | grep "^d"
drwxr-xr-x. 2 root root 137 Nov 18 01:21 bash[root@localhost ~]# find . -type d -maxdepth 1 -print
find: warning: you have specified the -maxdepth option after a non-option argument -type, but options are not positional (-maxdepth affects tests specified before it as well as those specified after it). Please specify options before other arguments.
.
./.ssh
./bash