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
Spacedust
  • 568
  • 5
  • 13
  • 28

2 Answers2

2

How about

quota -u testclient | tail -1 | awk '{print $2}'
MadHatter
  • 79,770
  • 20
  • 184
  • 232
  • 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}'
Danie
  • 1,360
  • 10
  • 12