See disk consume info using 'df' command on AIX
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I'm trying to get the fs that have high space consumed. I'm trying to do this using df
command with -g
flag (gigabyte view) and I can't obtain my expected value.
df -g | sed 's/%//g'| awk '+$5>=75 print' | head -10
With this command below I got an error:
df -g | sed 's/%//g'| awk 'print $5>=75' | head -4
Error Message:
Syntax Error The source line is 1.
The error context is
{print >>> $5>= <<<
awk: 0602-502 The statement cannot be correctly parsed. The source line is 1.
Here is the output of df -g command on AIX:
/tmp>df -g | sed 's/%//g'| awk '$5 >= 75 print ' | head -4
Filesystem GB blocks Free Used Iused Iused Mounted on
/dev/hd4 10.50 10.05 5 16492 1 /
/dev/hd2 25.50 18.15 29 64361 2 /usr
/dev/hd9var 2.50 0.72 72 4521 3 /var
Complete view:
Filesystem GB blocks Free %Used Iused %Iused Mounted on
/dev/hd4 10.50 10.05 5% 16492 1% /
/dev/hd2 25.50 18.15 29% 64357 2% /usr
/dev/hd9var 2.50 1.39 45% 4512 2% /var
/dev/hd3 21.50 20.24 6% 1495 1% /tmp
I tried on AIX 7.1 PowerPC_POWER8. I don't know what I'm doing wrong!
awk disk-usage aix
add a comment |Â
up vote
1
down vote
favorite
I'm trying to get the fs that have high space consumed. I'm trying to do this using df
command with -g
flag (gigabyte view) and I can't obtain my expected value.
df -g | sed 's/%//g'| awk '+$5>=75 print' | head -10
With this command below I got an error:
df -g | sed 's/%//g'| awk 'print $5>=75' | head -4
Error Message:
Syntax Error The source line is 1.
The error context is
{print >>> $5>= <<<
awk: 0602-502 The statement cannot be correctly parsed. The source line is 1.
Here is the output of df -g command on AIX:
/tmp>df -g | sed 's/%//g'| awk '$5 >= 75 print ' | head -4
Filesystem GB blocks Free Used Iused Iused Mounted on
/dev/hd4 10.50 10.05 5 16492 1 /
/dev/hd2 25.50 18.15 29 64361 2 /usr
/dev/hd9var 2.50 0.72 72 4521 3 /var
Complete view:
Filesystem GB blocks Free %Used Iused %Iused Mounted on
/dev/hd4 10.50 10.05 5% 16492 1% /
/dev/hd2 25.50 18.15 29% 64357 2% /usr
/dev/hd9var 2.50 1.39 45% 4512 2% /var
/dev/hd3 21.50 20.24 6% 1495 1% /tmp
I tried on AIX 7.1 PowerPC_POWER8. I don't know what I'm doing wrong!
awk disk-usage aix
I have no idea if this is required on the AIX flavor ofawk
or now, but try adding spaces? Also, your twoawk
statements are different.$5 >= 75 print
will print the input line if the fifth field is greater than or equal to 75;print $5 >= 75
will print a zero or one based on the truthiness of the inequality.
â DopeGhoti
Aug 23 '17 at 18:44
Yes, I know it. I want exactly the result of $5 >= 75 print but I cant see this result. I tried adding spaces and It does not work.
â vicdeveloper
Aug 23 '17 at 18:50
You should probably add an example of the output ofdf -g
to the text in the question. There's not many here with an AIX system at hand. Also, never say "it does not work" without also saying exactly in what way it doesn't work.
â Kusalananda
Aug 23 '17 at 19:02
Oks, I will edit main post.
â vicdeveloper
Aug 23 '17 at 19:03
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I'm trying to get the fs that have high space consumed. I'm trying to do this using df
command with -g
flag (gigabyte view) and I can't obtain my expected value.
df -g | sed 's/%//g'| awk '+$5>=75 print' | head -10
With this command below I got an error:
df -g | sed 's/%//g'| awk 'print $5>=75' | head -4
Error Message:
Syntax Error The source line is 1.
The error context is
{print >>> $5>= <<<
awk: 0602-502 The statement cannot be correctly parsed. The source line is 1.
Here is the output of df -g command on AIX:
/tmp>df -g | sed 's/%//g'| awk '$5 >= 75 print ' | head -4
Filesystem GB blocks Free Used Iused Iused Mounted on
/dev/hd4 10.50 10.05 5 16492 1 /
/dev/hd2 25.50 18.15 29 64361 2 /usr
/dev/hd9var 2.50 0.72 72 4521 3 /var
Complete view:
Filesystem GB blocks Free %Used Iused %Iused Mounted on
/dev/hd4 10.50 10.05 5% 16492 1% /
/dev/hd2 25.50 18.15 29% 64357 2% /usr
/dev/hd9var 2.50 1.39 45% 4512 2% /var
/dev/hd3 21.50 20.24 6% 1495 1% /tmp
I tried on AIX 7.1 PowerPC_POWER8. I don't know what I'm doing wrong!
awk disk-usage aix
I'm trying to get the fs that have high space consumed. I'm trying to do this using df
command with -g
flag (gigabyte view) and I can't obtain my expected value.
df -g | sed 's/%//g'| awk '+$5>=75 print' | head -10
With this command below I got an error:
df -g | sed 's/%//g'| awk 'print $5>=75' | head -4
Error Message:
Syntax Error The source line is 1.
The error context is
{print >>> $5>= <<<
awk: 0602-502 The statement cannot be correctly parsed. The source line is 1.
Here is the output of df -g command on AIX:
/tmp>df -g | sed 's/%//g'| awk '$5 >= 75 print ' | head -4
Filesystem GB blocks Free Used Iused Iused Mounted on
/dev/hd4 10.50 10.05 5 16492 1 /
/dev/hd2 25.50 18.15 29 64361 2 /usr
/dev/hd9var 2.50 0.72 72 4521 3 /var
Complete view:
Filesystem GB blocks Free %Used Iused %Iused Mounted on
/dev/hd4 10.50 10.05 5% 16492 1% /
/dev/hd2 25.50 18.15 29% 64357 2% /usr
/dev/hd9var 2.50 1.39 45% 4512 2% /var
/dev/hd3 21.50 20.24 6% 1495 1% /tmp
I tried on AIX 7.1 PowerPC_POWER8. I don't know what I'm doing wrong!
awk disk-usage aix
awk disk-usage aix
edited Aug 23 '17 at 20:14
Jeff Schaller
32.7k849110
32.7k849110
asked Aug 23 '17 at 18:27
vicdeveloper
68129
68129
I have no idea if this is required on the AIX flavor ofawk
or now, but try adding spaces? Also, your twoawk
statements are different.$5 >= 75 print
will print the input line if the fifth field is greater than or equal to 75;print $5 >= 75
will print a zero or one based on the truthiness of the inequality.
â DopeGhoti
Aug 23 '17 at 18:44
Yes, I know it. I want exactly the result of $5 >= 75 print but I cant see this result. I tried adding spaces and It does not work.
â vicdeveloper
Aug 23 '17 at 18:50
You should probably add an example of the output ofdf -g
to the text in the question. There's not many here with an AIX system at hand. Also, never say "it does not work" without also saying exactly in what way it doesn't work.
â Kusalananda
Aug 23 '17 at 19:02
Oks, I will edit main post.
â vicdeveloper
Aug 23 '17 at 19:03
add a comment |Â
I have no idea if this is required on the AIX flavor ofawk
or now, but try adding spaces? Also, your twoawk
statements are different.$5 >= 75 print
will print the input line if the fifth field is greater than or equal to 75;print $5 >= 75
will print a zero or one based on the truthiness of the inequality.
â DopeGhoti
Aug 23 '17 at 18:44
Yes, I know it. I want exactly the result of $5 >= 75 print but I cant see this result. I tried adding spaces and It does not work.
â vicdeveloper
Aug 23 '17 at 18:50
You should probably add an example of the output ofdf -g
to the text in the question. There's not many here with an AIX system at hand. Also, never say "it does not work" without also saying exactly in what way it doesn't work.
â Kusalananda
Aug 23 '17 at 19:02
Oks, I will edit main post.
â vicdeveloper
Aug 23 '17 at 19:03
I have no idea if this is required on the AIX flavor of
awk
or now, but try adding spaces? Also, your two awk
statements are different. $5 >= 75 print
will print the input line if the fifth field is greater than or equal to 75; print $5 >= 75
will print a zero or one based on the truthiness of the inequality.â DopeGhoti
Aug 23 '17 at 18:44
I have no idea if this is required on the AIX flavor of
awk
or now, but try adding spaces? Also, your two awk
statements are different. $5 >= 75 print
will print the input line if the fifth field is greater than or equal to 75; print $5 >= 75
will print a zero or one based on the truthiness of the inequality.â DopeGhoti
Aug 23 '17 at 18:44
Yes, I know it. I want exactly the result of $5 >= 75 print but I cant see this result. I tried adding spaces and It does not work.
â vicdeveloper
Aug 23 '17 at 18:50
Yes, I know it. I want exactly the result of $5 >= 75 print but I cant see this result. I tried adding spaces and It does not work.
â vicdeveloper
Aug 23 '17 at 18:50
You should probably add an example of the output of
df -g
to the text in the question. There's not many here with an AIX system at hand. Also, never say "it does not work" without also saying exactly in what way it doesn't work.â Kusalananda
Aug 23 '17 at 19:02
You should probably add an example of the output of
df -g
to the text in the question. There's not many here with an AIX system at hand. Also, never say "it does not work" without also saying exactly in what way it doesn't work.â Kusalananda
Aug 23 '17 at 19:02
Oks, I will edit main post.
â vicdeveloper
Aug 23 '17 at 19:03
Oks, I will edit main post.
â vicdeveloper
Aug 23 '17 at 19:03
add a comment |Â
3 Answers
3
active
oldest
votes
up vote
1
down vote
accepted
Concentrating on the awk
code:
awk 'print $5>=75'
This should probably be
awk '$5 >= 75 print '
which will output the current input record if its fifth field is numerically greater than or equal to 75.
Judging from the output that you get, you probably want to check $4
rather than $5
though since I presume it's the fourth field that contains the percentage:
df -g | tr -d '%' | awk '$4 >= 75 print ' | head -4
Looking at the error message:
Using awk
on OpenBSD (which seems to complain in exactly the same way as your AIX awk
), the original code has a syntax error in that it's not possible to print $5 >= 75
(unless put inside parentheses in which case it will evaluate to 0 (false) or 1 (true)). mawk
behaves the same.
GNU awk
accepts the syntax in the original code, but it's obviously still not what you want.
BSDawk
(as provided by McOS) is also perfectly happy with this syntax, but throwing it into a parenthetical is probably a good idea anyhow, to make it clear that you want to be doing what you're doing in five years when future-you is reading theawk
script.
â DopeGhoti
Aug 23 '17 at 18:56
1
@Kusulananda: I edited the main post and added the df -g command output.
â vicdeveloper
Aug 23 '17 at 19:12
@vicdeveloper Updated. Since you didn't show thedf -g
output I'm only guessing that you actually want column 4 rather than 5. It's hard to tell with the%
removed.
â Kusalananda
Aug 23 '17 at 19:20
See the main post. I added the complete view.
â vicdeveloper
Aug 23 '17 at 19:22
1
Hello, I find my expected result using this command:**df -g | tr -d '%' | awk '$4 >= 70 print ' | awk 'print $4, $7'| sort -n | uniq**
Many thanks for all of your responses.
â vicdeveloper
Aug 23 '17 at 19:38
 |Â
show 2 more comments
up vote
2
down vote
Instead of using tr
and awk
twice, just use awk once:
df -g | awk ' sub("%", "", $4); if ($4 >= 75) print $4, $7 ' | sort -n
This replaces the percent signs in field 4 with the empty string (stripping them off); if the remaining value is at least 75, print fields 4 and 7, then pipe them to sort.
An improvement, based on remembering one of Stéphane's answers:
df -g | awk '$4+0 >= 75 print $4, $7 ' | sort -n
The "+0" addition forces a numerical comparison instead of a strictly string-based comparison.
If you want to keep the header, change the criteria to:
df -g | awk 'NR < 2 || $4+0 >= 75 print $4, $7 ' | sort -n
add a comment |Â
up vote
0
down vote
This is the error ... 'Filesystem GB blocks Free Used Iused Iused Mounted on'
The solution is:
# df -g | grep Filesystem | sed 's/%//g'| awk 'print $5>=75' | head -4
add a comment |Â
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
Concentrating on the awk
code:
awk 'print $5>=75'
This should probably be
awk '$5 >= 75 print '
which will output the current input record if its fifth field is numerically greater than or equal to 75.
Judging from the output that you get, you probably want to check $4
rather than $5
though since I presume it's the fourth field that contains the percentage:
df -g | tr -d '%' | awk '$4 >= 75 print ' | head -4
Looking at the error message:
Using awk
on OpenBSD (which seems to complain in exactly the same way as your AIX awk
), the original code has a syntax error in that it's not possible to print $5 >= 75
(unless put inside parentheses in which case it will evaluate to 0 (false) or 1 (true)). mawk
behaves the same.
GNU awk
accepts the syntax in the original code, but it's obviously still not what you want.
BSDawk
(as provided by McOS) is also perfectly happy with this syntax, but throwing it into a parenthetical is probably a good idea anyhow, to make it clear that you want to be doing what you're doing in five years when future-you is reading theawk
script.
â DopeGhoti
Aug 23 '17 at 18:56
1
@Kusulananda: I edited the main post and added the df -g command output.
â vicdeveloper
Aug 23 '17 at 19:12
@vicdeveloper Updated. Since you didn't show thedf -g
output I'm only guessing that you actually want column 4 rather than 5. It's hard to tell with the%
removed.
â Kusalananda
Aug 23 '17 at 19:20
See the main post. I added the complete view.
â vicdeveloper
Aug 23 '17 at 19:22
1
Hello, I find my expected result using this command:**df -g | tr -d '%' | awk '$4 >= 70 print ' | awk 'print $4, $7'| sort -n | uniq**
Many thanks for all of your responses.
â vicdeveloper
Aug 23 '17 at 19:38
 |Â
show 2 more comments
up vote
1
down vote
accepted
Concentrating on the awk
code:
awk 'print $5>=75'
This should probably be
awk '$5 >= 75 print '
which will output the current input record if its fifth field is numerically greater than or equal to 75.
Judging from the output that you get, you probably want to check $4
rather than $5
though since I presume it's the fourth field that contains the percentage:
df -g | tr -d '%' | awk '$4 >= 75 print ' | head -4
Looking at the error message:
Using awk
on OpenBSD (which seems to complain in exactly the same way as your AIX awk
), the original code has a syntax error in that it's not possible to print $5 >= 75
(unless put inside parentheses in which case it will evaluate to 0 (false) or 1 (true)). mawk
behaves the same.
GNU awk
accepts the syntax in the original code, but it's obviously still not what you want.
BSDawk
(as provided by McOS) is also perfectly happy with this syntax, but throwing it into a parenthetical is probably a good idea anyhow, to make it clear that you want to be doing what you're doing in five years when future-you is reading theawk
script.
â DopeGhoti
Aug 23 '17 at 18:56
1
@Kusulananda: I edited the main post and added the df -g command output.
â vicdeveloper
Aug 23 '17 at 19:12
@vicdeveloper Updated. Since you didn't show thedf -g
output I'm only guessing that you actually want column 4 rather than 5. It's hard to tell with the%
removed.
â Kusalananda
Aug 23 '17 at 19:20
See the main post. I added the complete view.
â vicdeveloper
Aug 23 '17 at 19:22
1
Hello, I find my expected result using this command:**df -g | tr -d '%' | awk '$4 >= 70 print ' | awk 'print $4, $7'| sort -n | uniq**
Many thanks for all of your responses.
â vicdeveloper
Aug 23 '17 at 19:38
 |Â
show 2 more comments
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Concentrating on the awk
code:
awk 'print $5>=75'
This should probably be
awk '$5 >= 75 print '
which will output the current input record if its fifth field is numerically greater than or equal to 75.
Judging from the output that you get, you probably want to check $4
rather than $5
though since I presume it's the fourth field that contains the percentage:
df -g | tr -d '%' | awk '$4 >= 75 print ' | head -4
Looking at the error message:
Using awk
on OpenBSD (which seems to complain in exactly the same way as your AIX awk
), the original code has a syntax error in that it's not possible to print $5 >= 75
(unless put inside parentheses in which case it will evaluate to 0 (false) or 1 (true)). mawk
behaves the same.
GNU awk
accepts the syntax in the original code, but it's obviously still not what you want.
Concentrating on the awk
code:
awk 'print $5>=75'
This should probably be
awk '$5 >= 75 print '
which will output the current input record if its fifth field is numerically greater than or equal to 75.
Judging from the output that you get, you probably want to check $4
rather than $5
though since I presume it's the fourth field that contains the percentage:
df -g | tr -d '%' | awk '$4 >= 75 print ' | head -4
Looking at the error message:
Using awk
on OpenBSD (which seems to complain in exactly the same way as your AIX awk
), the original code has a syntax error in that it's not possible to print $5 >= 75
(unless put inside parentheses in which case it will evaluate to 0 (false) or 1 (true)). mawk
behaves the same.
GNU awk
accepts the syntax in the original code, but it's obviously still not what you want.
edited Aug 23 '17 at 19:12
answered Aug 23 '17 at 18:50
Kusalananda
107k14209329
107k14209329
BSDawk
(as provided by McOS) is also perfectly happy with this syntax, but throwing it into a parenthetical is probably a good idea anyhow, to make it clear that you want to be doing what you're doing in five years when future-you is reading theawk
script.
â DopeGhoti
Aug 23 '17 at 18:56
1
@Kusulananda: I edited the main post and added the df -g command output.
â vicdeveloper
Aug 23 '17 at 19:12
@vicdeveloper Updated. Since you didn't show thedf -g
output I'm only guessing that you actually want column 4 rather than 5. It's hard to tell with the%
removed.
â Kusalananda
Aug 23 '17 at 19:20
See the main post. I added the complete view.
â vicdeveloper
Aug 23 '17 at 19:22
1
Hello, I find my expected result using this command:**df -g | tr -d '%' | awk '$4 >= 70 print ' | awk 'print $4, $7'| sort -n | uniq**
Many thanks for all of your responses.
â vicdeveloper
Aug 23 '17 at 19:38
 |Â
show 2 more comments
BSDawk
(as provided by McOS) is also perfectly happy with this syntax, but throwing it into a parenthetical is probably a good idea anyhow, to make it clear that you want to be doing what you're doing in five years when future-you is reading theawk
script.
â DopeGhoti
Aug 23 '17 at 18:56
1
@Kusulananda: I edited the main post and added the df -g command output.
â vicdeveloper
Aug 23 '17 at 19:12
@vicdeveloper Updated. Since you didn't show thedf -g
output I'm only guessing that you actually want column 4 rather than 5. It's hard to tell with the%
removed.
â Kusalananda
Aug 23 '17 at 19:20
See the main post. I added the complete view.
â vicdeveloper
Aug 23 '17 at 19:22
1
Hello, I find my expected result using this command:**df -g | tr -d '%' | awk '$4 >= 70 print ' | awk 'print $4, $7'| sort -n | uniq**
Many thanks for all of your responses.
â vicdeveloper
Aug 23 '17 at 19:38
BSD
awk
(as provided by McOS) is also perfectly happy with this syntax, but throwing it into a parenthetical is probably a good idea anyhow, to make it clear that you want to be doing what you're doing in five years when future-you is reading the awk
script.â DopeGhoti
Aug 23 '17 at 18:56
BSD
awk
(as provided by McOS) is also perfectly happy with this syntax, but throwing it into a parenthetical is probably a good idea anyhow, to make it clear that you want to be doing what you're doing in five years when future-you is reading the awk
script.â DopeGhoti
Aug 23 '17 at 18:56
1
1
@Kusulananda: I edited the main post and added the df -g command output.
â vicdeveloper
Aug 23 '17 at 19:12
@Kusulananda: I edited the main post and added the df -g command output.
â vicdeveloper
Aug 23 '17 at 19:12
@vicdeveloper Updated. Since you didn't show the
df -g
output I'm only guessing that you actually want column 4 rather than 5. It's hard to tell with the %
removed.â Kusalananda
Aug 23 '17 at 19:20
@vicdeveloper Updated. Since you didn't show the
df -g
output I'm only guessing that you actually want column 4 rather than 5. It's hard to tell with the %
removed.â Kusalananda
Aug 23 '17 at 19:20
See the main post. I added the complete view.
â vicdeveloper
Aug 23 '17 at 19:22
See the main post. I added the complete view.
â vicdeveloper
Aug 23 '17 at 19:22
1
1
Hello, I find my expected result using this command:
**df -g | tr -d '%' | awk '$4 >= 70 print ' | awk 'print $4, $7'| sort -n | uniq**
Many thanks for all of your responses.â vicdeveloper
Aug 23 '17 at 19:38
Hello, I find my expected result using this command:
**df -g | tr -d '%' | awk '$4 >= 70 print ' | awk 'print $4, $7'| sort -n | uniq**
Many thanks for all of your responses.â vicdeveloper
Aug 23 '17 at 19:38
 |Â
show 2 more comments
up vote
2
down vote
Instead of using tr
and awk
twice, just use awk once:
df -g | awk ' sub("%", "", $4); if ($4 >= 75) print $4, $7 ' | sort -n
This replaces the percent signs in field 4 with the empty string (stripping them off); if the remaining value is at least 75, print fields 4 and 7, then pipe them to sort.
An improvement, based on remembering one of Stéphane's answers:
df -g | awk '$4+0 >= 75 print $4, $7 ' | sort -n
The "+0" addition forces a numerical comparison instead of a strictly string-based comparison.
If you want to keep the header, change the criteria to:
df -g | awk 'NR < 2 || $4+0 >= 75 print $4, $7 ' | sort -n
add a comment |Â
up vote
2
down vote
Instead of using tr
and awk
twice, just use awk once:
df -g | awk ' sub("%", "", $4); if ($4 >= 75) print $4, $7 ' | sort -n
This replaces the percent signs in field 4 with the empty string (stripping them off); if the remaining value is at least 75, print fields 4 and 7, then pipe them to sort.
An improvement, based on remembering one of Stéphane's answers:
df -g | awk '$4+0 >= 75 print $4, $7 ' | sort -n
The "+0" addition forces a numerical comparison instead of a strictly string-based comparison.
If you want to keep the header, change the criteria to:
df -g | awk 'NR < 2 || $4+0 >= 75 print $4, $7 ' | sort -n
add a comment |Â
up vote
2
down vote
up vote
2
down vote
Instead of using tr
and awk
twice, just use awk once:
df -g | awk ' sub("%", "", $4); if ($4 >= 75) print $4, $7 ' | sort -n
This replaces the percent signs in field 4 with the empty string (stripping them off); if the remaining value is at least 75, print fields 4 and 7, then pipe them to sort.
An improvement, based on remembering one of Stéphane's answers:
df -g | awk '$4+0 >= 75 print $4, $7 ' | sort -n
The "+0" addition forces a numerical comparison instead of a strictly string-based comparison.
If you want to keep the header, change the criteria to:
df -g | awk 'NR < 2 || $4+0 >= 75 print $4, $7 ' | sort -n
Instead of using tr
and awk
twice, just use awk once:
df -g | awk ' sub("%", "", $4); if ($4 >= 75) print $4, $7 ' | sort -n
This replaces the percent signs in field 4 with the empty string (stripping them off); if the remaining value is at least 75, print fields 4 and 7, then pipe them to sort.
An improvement, based on remembering one of Stéphane's answers:
df -g | awk '$4+0 >= 75 print $4, $7 ' | sort -n
The "+0" addition forces a numerical comparison instead of a strictly string-based comparison.
If you want to keep the header, change the criteria to:
df -g | awk 'NR < 2 || $4+0 >= 75 print $4, $7 ' | sort -n
edited Aug 23 '17 at 20:22
answered Aug 23 '17 at 19:51
Jeff Schaller
32.7k849110
32.7k849110
add a comment |Â
add a comment |Â
up vote
0
down vote
This is the error ... 'Filesystem GB blocks Free Used Iused Iused Mounted on'
The solution is:
# df -g | grep Filesystem | sed 's/%//g'| awk 'print $5>=75' | head -4
add a comment |Â
up vote
0
down vote
This is the error ... 'Filesystem GB blocks Free Used Iused Iused Mounted on'
The solution is:
# df -g | grep Filesystem | sed 's/%//g'| awk 'print $5>=75' | head -4
add a comment |Â
up vote
0
down vote
up vote
0
down vote
This is the error ... 'Filesystem GB blocks Free Used Iused Iused Mounted on'
The solution is:
# df -g | grep Filesystem | sed 's/%//g'| awk 'print $5>=75' | head -4
This is the error ... 'Filesystem GB blocks Free Used Iused Iused Mounted on'
The solution is:
# df -g | grep Filesystem | sed 's/%//g'| awk 'print $5>=75' | head -4
edited Aug 24 at 3:36
fpmurphy1
2,250915
2,250915
answered Aug 23 at 22:53
Henrique Nunes
1
1
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f387954%2fsee-disk-consume-info-using-df-command-on-aix%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
I have no idea if this is required on the AIX flavor of
awk
or now, but try adding spaces? Also, your twoawk
statements are different.$5 >= 75 print
will print the input line if the fifth field is greater than or equal to 75;print $5 >= 75
will print a zero or one based on the truthiness of the inequality.â DopeGhoti
Aug 23 '17 at 18:44
Yes, I know it. I want exactly the result of $5 >= 75 print but I cant see this result. I tried adding spaces and It does not work.
â vicdeveloper
Aug 23 '17 at 18:50
You should probably add an example of the output of
df -g
to the text in the question. There's not many here with an AIX system at hand. Also, never say "it does not work" without also saying exactly in what way it doesn't work.â Kusalananda
Aug 23 '17 at 19:02
Oks, I will edit main post.
â vicdeveloper
Aug 23 '17 at 19:03