Logo
Print this page

LINUX: get file size by user

(Reading time: 1 minute)

Sometimes it is necessary to list files size by users. For this you can use these basic Linux commands.

 

Formátovaný zápis:

find /path -type f -printf '%u %k\n' | awk '{ 
arr[$1] += $2
} END {
for ( i in arr ) {
print i": "arr[i]"K"
}
}';

 

Jednořádkový zápis:

find /path -type f -printf '%u %k\n' | awk '{ arr[$1] += $2 } END { for ( i in arr ) { print i": "arr[i]"K" } }';

Výpis:

vaclavd: 70892344K
root: 16K
Václav

Programátor... občas normální, častěji tak trochu blázen.

Website: www.valeas.cz

 

Template Design © Joomla Templates | GavickPro. All rights reserved.