0

I would like to get first number from:

[root@nowosci /]# quota -u testclient
Ograniczenia dyskowe user testclient (uid 7798):
System plików   bloki miękki  twardy  pobł.   pliki miękki  twardy  pobł.
/dev/root  100256  51200000 51200000              34       0       0

So it will return just 100256

So far I went to this:

quota -u testclient | grep -Eo '[0-9]{6,10}'                          
100256
51200000
51200000
2

How about

quota -u testclient | tail -1 | awk '{print $2}'
1
  • Good. Umm, feel free to accept the answer, then, by clicking the tick outline next to it. My apologies if you are already familiar with the practice! – MadHatter Apr 25 '13 at 11:05
2

Another way of doing it :)

quota -u testclient | awk '/\/dev\/root/ {print $2}'
1
  • 1
    This one is preferable as it specifies the desired mount point. – SmallClanger Apr 25 '13 at 11:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.