网站运营服务中心建设方案,百度高级搜索技巧,php网站怎么做伪静态,计算机多媒体毕业设计网站建设在qnx上使用du命令统计目录大小时#xff0c;发现统计数值与实际大小不一样。
比如目录下有个已知1gb大小的问题#xff0c;但du统计出来的值跟1gb差太多了
# ls -al
total 2097169
drwxrwxrwx 2 root root 4096 Jan 01 00:21 .
drwxrwxrwx 6 root …在qnx上使用du命令统计目录大小时发现统计数值与实际大小不一样。
比如目录下有个已知1gb大小的问题但du统计出来的值跟1gb差太多了
# ls -al
total 2097169
drwxrwxrwx 2 root root 4096 Jan 01 00:21 .
drwxrwxrwx 6 root root 4096 Jan 01 00:07 ..
-rw-r--r-- 1 root root 1073741825 Jan 01 00:21 1gb.bin
# du -s2097161 .
查看qnx关于du命令的文档 The space figures are displayed in 512-byte blocks by default. If you want du to print the size in bytes, you specify the -p option. The sizes output by du when you specify the -p option are accurate with one exception. The numbers may be slightly higher than expected because they include extent blocks that are part of filesystem overhead associated with the file, but don’t contain actual data. If you specify nondirectories, they aren’t listed unless you specify the -a option. Files with multiple links are reported only once. 与Linux不同的是du -s显示的大小是以512byte为单位的也就是说du -s的值x512后等于实际大小。如果想直接以1byte为单位显示把-s参数改为-p参数即可。
# ls -al
total 2097169
drwxrwxrwx 2 root root 4096 Jan 01 00:21 .
drwxrwxrwx 6 root root 4096 Jan 01 00:07 ..
-rw-r--r-- 1 root root 1073741825 Jan 01 00:21 1gb.bin
# du -p1073746432 .