You're viewing a comment by Sydney and its responses.

Sydney Permalink
October 07, 2008, 07:23

Thanks so much Peter,

I am only ever using GNU AWK on Redhat or Ubuntu maybe Debian rarely. So I mutated the first into:

df -h | awk '/\// { if (strtonum($(NF-1)) >= 20) { print $NF ": " $(NF-1) } }'

I am guessing that strtonum function that you suggested takes it out of the string world. I was trying to compare a string to a number.

The RegEx /\// found all mounts.

df output is not constant in Red Hat with long mount names

/shrug

Who knew? So I changed the code to work backwards from the last field.

Thanks a bunch this was an interesting experiment for me that I may turn around and tweak for production.

Comment Responses

seven Permalink
August 04, 2010, 06:14

Hi,

Please let me know the command to list files having specific number of rows. I want to list all the files having only 3 rows only.

Regards,

Reply To This Comment

(why do I need your e-mail?)

(Your twitter handle, if you have one.)

Type the word "antispam_92": (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.