Hot answers tagged

7

TL;DR: ls and awk are unnecessary for your purpose. Use du -cb or du -bs on the directory that you want to analyse. Your purpose is to Find all files find their size (in bytes) produce grand total for all of them All these actions can be performed by du. $ du -bs $HOME 2>/dev/null ...


6

The problem is that MAWK (the AWK variant installed on Ubuntu) by default prints integers bigger than 2147483647 (231-1) in scientific notation: % awk -W version mawk 1.3.3 Nov 1996, Copyright (C) Michael D. Brennan compiled limits: max NF 32767 sprintf buffer 2040 % printf '2147483647\n' | awk '{x += $1; print x}' 2147483647 % printf ...


4

Under the hood, awk does all calculations using double-precision floating point numbers. By default it prints them using printf(3) format specifier %.6g, which means that if the number is more than six digits wide it will switch over to E-notation, which is what you saw. You can work around this by setting the variable OFMT: ls -lR | awk 'BEGIN { OFMT ...


3

What you see here is a way to display large numbers. For example: 1.23e+3 = 1.23*10^3 = 1230 As far as I know, you cannot turn this off, but as you wrote in your question, du does behave differently, so I would recommend to use this. Otherwise, you would have to convert the numbers.


1

With the following command you can find the recently modified/created file on the system disregarding the file size: find ${1} -type f -size +1G| xargs stat --format '%Y :%y %n' 2>/dev/null | sort -nr | cut -d: -f2-


1

You can go to File > Project Structure and from the left panel select SDK Location as in the bottom image. There you can see or change the location of your SDK/NDK.



Only top voted, non community-wiki answers of a minimum length are eligible