Linked Questions

1 vote
1 answer
153 views

What is th difference betwen stat -c %B and stat -c %o? [duplicate]

For academic purposes im trying to demonstrate internal fragmentation of a file. As i understand it, internal fragmentation can be shown as a difference between the size of file and the size of all ...
139 votes
4 answers
16k views

Why are there so many different ways to measure disk usage?

When I sum up the sizes of my files, I get one figure. If I run du, I get another figure. If I run du on all the files on my partition, it doesn't match what df claims is used. Why are there so many ...
44 votes
3 answers
112k views

What is the difference between 'bs', 'count' and 'seek' in dd command?

I've read many guides and forum posts describing how to use dd, but one thing I've noticed is that people always use different values for the bs=, count= and seek= switches. Please can someone explain ...
Eric's user avatar
  • 457
14 votes
3 answers
28k views

file block size - difference between stat and ls

I've noticed that when I do a: ls -ls file It provides block count, say 8 blocks. When I do: stat file I notice that the block count is 16, twice the number given by ls. The block size on my file ...
17 votes
2 answers
6k views

`du -s .` and `du -hs .` gives different results (on OS X)

The difference with and without -h should only be the human readable units, right? Well apparently no... $ du -s . 74216696 . $ du -hs . 35G . Or maybe I'm mistaken and the result of du -s . ...
Creak's user avatar
  • 324
3 votes
4 answers
9k views

How to get size of a block special file? [duplicate]

I need to be able to determine the size of a block special file. For example, given /dev/sda, I need a command that will provide the size of the device. (By size I mean capacity, since this is a ...
10 votes
3 answers
1k views

Should I attempt to 'balance' my threads or does linux do this?

A simple example. I'm running a process that serves http request using TCP sockets. It might A) calculate something which means CPU will be the bottleneck B) Send a large file which may cause the ...
2 votes
3 answers
3k views

ls -ls output shows larger number of blocks than the file size

As far as i know the ls command with the "-s" option print the file size in blocks , ls uses the 1024 as block size , but i noticed something weird . For better understanding consider the ...
Colin Jack's user avatar
0 votes
1 answer
357 views

"stat /etc" size mismatch: 24 blocks, size 8192 instead of 12288

My stat /etc command shows that the number of blocks is 24. I understand that a block here means 512 bytes. So the total size is 24 ×ばつ 512 which makes it 12288 bytes. But it shows 8192 bytes instead, ...
0 votes
0 answers
76 views

Why do directories with many different files take up more space on my external SSD than they do on my root disk?

I have a root disk (SSD) on a MacBook Pro and an external SSD. I have some directories that contain many thousands of image files, and while copying these to the external SSD, I noticed that what ...
John Allard's user avatar
  • 1,408