Need help with grep

Under development: PCMCIA, wireless, etc.
Post Reply
Message
Author
User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

Need help with grep

#1 Post by BarryK »

Could one of you guys who really know how to use grep, or for that matter, any other stream editor, help me out here? papasmurf is a wiz at grep, but he's on holiday!

I have various scripts that use "df" to find what is mounted on "/".
Now, the df in Busybox 0.60.5 gives different output to that in 1.01.
V0.60.5 always shows two almost-identical lines, for example:

rootfs 513688 59416 454272 12% /
/dev/hda3 513688 59416 454272 12% /

The second line is the actual device in the first field that is mounted on /.
This is convenience, as my scripts just grep for "rootfs" to get the info.

However, the new df only displays the second line.

So what I want is:
df | grep "something-in-here"
to extract the line that has "/" on the very end of the line.
...anyone know how to do that?

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#2 Post by GuestToo »

something like:

df | grep ' /$'

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#3 Post by BarryK »

That's it!
Thanks very much. :)

Post Reply