du

Exclude all permission denied messages from “du”

跟風遠走 提交于 2019-11-28 22:05:56
问题 I am trying to evaluate the disk usage of a number of Unix user accounts. Simply, I am using the following command: du -cBM --max-depth=1 | sort -n But I’ve seen many error message like below. How can I exclude all such “Permission denied” messages from display? du: `./james/.gnome2': Permission denied My request could be very similar to the following list, by replacing “find” to “du”. How can I exclude all "permission denied" messages from "find"? The following thread does not work. I guess

Size() vs ls -la vs du -h which one is correct size?

核能气质少年 提交于 2019-11-27 16:09:30
I was compiling a custom kernel, and I wanted to test the size of the image file. These are the results: ls -la | grep vmlinux -rwxr-xr-x 1 root root 8167158 May 21 12:14 vmlinux du -h vmlinux 3.8M vmlinux size vmlinux text data bss dec hex filename 2221248 676148 544768 3442164 3485f4 vmlinux Since all of them show different sizes, which one is closest to the actual image size? Why are they different? They are all correct, they just show different sizes. ls shows size of the file (when you open and read it, that's how many bytes you will get) du shows actual disk usage which can be smaller

Error when calling 3rd party executable from Powershell when using an IDE

雨燕双飞 提交于 2019-11-27 11:11:16
I have a PowerShell script that uses du.exe ( Disk Usage originally from Sysinternals) to calculate the size of directories. If I run du c:\Backup in the console, it works as expected, but the same line of code run in ISE or PowerGui gives the expected result plus the error + du <<<< c:\backup + CategoryInfo : NotSpecified: (:String) [], RemoteException + FullyQualifiedErrorId : NativeCommandError Why is that? How do I avoid this error? I tried invoke-expression, using & , but no go. Thanks for the help. To avoid this you can redirect stderr to null e.g.: du 2> $null Essentially the console

why is the output of `du` often so different from `du -b`

社会主义新天地 提交于 2019-11-27 01:25:51
why is the output of du often so different from du -b ? -b is shorthand for --apparent-size --block-size=1 . only using --apparent-size gives me the same result most of the time, but --block-size=1 seems to do the trick. i wonder if the output is then correct even, and which numbers are the ones i want? (i.e. actual filesize, if copied to another storage device) Apparent size is the number of bytes your applications think are in the file. It's the amount of data that would be transferred over the network (not counting protocol headers) if you decided to send the file over FTP or HTTP. It's

Error when calling 3rd party executable from Powershell when using an IDE

ぃ、小莉子 提交于 2019-11-26 15:25:24
问题 I have a PowerShell script that uses du.exe (Disk Usage originally from Sysinternals) to calculate the size of directories. If I run du c:\Backup in the console, it works as expected, but the same line of code run in ISE or PowerGui gives the expected result plus the error + du <<<< c:\backup + CategoryInfo : NotSpecified: (:String) [], RemoteException + FullyQualifiedErrorId : NativeCommandError Why is that? How do I avoid this error? I tried invoke-expression, using & , but no go. Thanks

why is the output of `du` often so different from `du -b`

ε祈祈猫儿з 提交于 2019-11-26 12:27:07
问题 why is the output of du often so different from du -b ? -b is shorthand for --apparent-size --block-size=1 . only using --apparent-size gives me the same result most of the time, but --block-size=1 seems to do the trick. i wonder if the output is then correct even, and which numbers are the ones i want? (i.e. actual filesize, if copied to another storage device) 回答1: Apparent size is the number of bytes your applications think are in the file. It's the amount of data that would be transferred