Sure!
I'm not an awk expert but here we go!
"count" is where the size is going to be contained.
In the first {}, for each line (result of du), count will increment by adding the first field value, represented by $1 (by default fields are separated by spaces and/or tabs). In this case, the first field is the size of the folder. And print the whole line.
Finally, in the second {}, the result is shown.
Regards.
Sure!
I'm not an awk expert but here we go!
"count" is where the size is going to be contained.
In the first {}, for each line (result of du), count will increment by adding the first field value, represented by $1 (by default fields are separated by spaces and/or tabs). In this case, the first field is the size of the folder. And print the whole line.
Finally, in the second {}, the result is shown.
Regards.
Grial thanks for your explanation and very great of you .. Please let me know why we are using print here "{count+=$1; print}" . please let me know the use of print here if we didnt use print here is it right ?? .Let me know ,also with that i am new to AWK...