Tag Info

New answers tagged

0

OS X 10.6 chokes on the command in the accepted answer, because it doesn't specify a path for find. Instead use: find . -maxdepth 1 -type d | while read -r dir; do printf "%s:\t" "$dir"; find "$dir" -type f | wc -l; done


3

The "apparent size" of a file is how much valid data is actually in the file. It is the actual amount of data that can be read from the file. Block-oriented devices can only store in terms of blocks, not bytes. As a result, the disk usage is always rounded up to the next highest block. A "block" in this case may not equate to a physical block on the storage ...


2

You can use iotop -b (batch mode) inside of a loop based on # of seconds. That will spit out everything and then redirect it to a file. I'm trying to find a shell loop example to do that but i don't do shell programming much. If i started the command by hand, i would run: iotop -botqk > ~/log-iotop.txt or something similar. Hope that helps!


4

If you go back 15-20 years the power-of-2 math was sensible, as it did match up with the storage blocks as mentioned in other answers. Then we encounter the inertia factor where 'we always did it that way' kicks in. And the small difference between ^2 and ^10 never added up to much. Software providers used ^2 for convenience (and inertia), drive ...


3

If a particular storage medium uses allocation units of e.g. 1024 bytes, knowing that a file took 260K on disk would imply that it took 260 storage units. If instead the space were reported as 260k, it would be unclear whether that meant 253 storage units (259,072, rounded up to 260) or 254 storage units (260,096 bytes). The avoidance of such ambiguity was ...


9

I speculate that this is due to storage manufacturers using the SI decimal prefixes near-universally. Further on in the manpage (assuming GNU df): SIZE is an integer and optional unit (example: 10M is 10*1024*1024). Units are K, M, G, T, P, E, Z, Y (powers of 1024) or KB, MB, ... (pow‐ ers of 1000). So 1K is 1024. In another GNU tool, dd, ...


0

You might do... findmnt -DP /dev/xvda1 Which is pretty close to what you want. Here's what my /dev/sda1 gets: findmnt -DP /dev/sda1 SOURCE="/dev/sda1" FSTYPE="vfat" SIZE="3G" USED="306.5M" AVAIL="2.7G" USE%="10%" TARGET="/esp" You can optionally specify the fields further with the --output switch.


2

Try doing this : LANG=C df -h /dev/xvda1 | awk 'NR>1{print "Filesystem: "$1 " Size: " $2 " Used: " $3 " Avail: " $4 " Use%:" $5 " Mounted on: " $6}'


0

I prefer the following command line: $ du -s -m -x * | sort -n Breaking it down, du shows disk usage; -s says print the total for each argument (each item in the current directory), -m says show the size in Megabytes. This makes it easier for sort to work; sort doesn't really understand the -h output. The -x ignores other filesystems; this is useful ...


0

This one handles filenames with whitespace or apostrophes, and works on systems which do not support xargs -d or sort -h: du -s * | sort -n | cut -f2 | tr '\n' '\0' | xargs -0 -I {} du -sh "{}" which results in: 368K diskmanagementd 392K racoon 468K coreaudiod 472K securityd 660K sshd 3.6M php-fpm


0

Your first bet if you want to keep/fix most of the content: Connect it to a real windows box, and run chkdsk /f /r upon that drive Warning: This may take several hours. Check e.g. http://technet.microsoft.com/en-us/magazine/ee872425.aspx for the usage. As the used filesystem was not specified, I'm also assuming NTFS due to the obvious autorun.inf file and ...


1

Why not just delete the annals directory? # rm -r /run/media/Harry/CA6C321E6C32062B/annals Note: It looks like it's been in a Windows machine as it has a System Volume Information directory. This means it's probably NTFS? If that's the case, then you'd be better off formatting it with a more *nix friendly filesystem. Of course, that assumes you don't ...



Top 50 recent answers are included