<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: grep - how to exclude fields ? in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/grep-how-to-exclude-fields/m-p/3969168#M95264</link>
    <description>Lots of ways to get that done, mainly because there are a number of sources for that information: commands "df" and  "bdf", as well as files "/etc/fstab" and "/etc/mnttab" .&lt;BR /&gt;&lt;BR /&gt;An easier one than the previous posting would be:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; df | grep stand | cut -b -15,33-42&lt;BR /&gt;&lt;BR /&gt;And actually &lt;BR /&gt;&amp;gt; df -n | grep stand&lt;BR /&gt;&lt;BR /&gt;gets you pretty close to what you asked for w/o stream edits.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;If you're wanting make sure to avoid the "bdf" line wrap problem indirectly mentioned in a previous posting use the contents /etc/mnttab instead:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; grep stand /etc/mnttab | cut -d "/" -f 4,5 | cut -d " " -f 1,2&lt;BR /&gt;&lt;BR /&gt;gives:&lt;BR /&gt;&lt;BR /&gt;lvol1 /stand&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Mon, 26 Mar 2007 13:39:36 GMT</pubDate>
    <dc:creator>TwoProc</dc:creator>
    <dc:date>2007-03-26T13:39:36Z</dc:date>
    <item>
      <title>grep - how to exclude fields ?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/grep-how-to-exclude-fields/m-p/3969161#M95257</link>
      <description>Hi there&lt;BR /&gt;&lt;BR /&gt;bdf |grep /stand&lt;BR /&gt;&lt;BR /&gt;output:&lt;BR /&gt;&lt;BR /&gt;/dev/vg00/lvol1 295024 59344 206176 22% /stand&lt;BR /&gt;&lt;BR /&gt;I nead o exclude all but lvol1 and /stand&lt;BR /&gt;&lt;BR /&gt;Can anyone help ?&lt;BR /&gt;&lt;BR /&gt;Cheers</description>
      <pubDate>Mon, 26 Mar 2007 11:34:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/grep-how-to-exclude-fields/m-p/3969161#M95257</guid>
      <dc:creator>Piotr Kirklewski</dc:creator>
      <dc:date>2007-03-26T11:34:11Z</dc:date>
    </item>
    <item>
      <title>Re: grep - how to exclude fields ?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/grep-how-to-exclude-fields/m-p/3969162#M95258</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;try something like this:&lt;BR /&gt;&lt;BR /&gt;$ bdf | grep stand| awk '{print $1,$NF}'&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;John K.</description>
      <pubDate>Mon, 26 Mar 2007 11:38:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/grep-how-to-exclude-fields/m-p/3969162#M95258</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2007-03-26T11:38:09Z</dc:date>
    </item>
    <item>
      <title>Re: grep - how to exclude fields ?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/grep-how-to-exclude-fields/m-p/3969163#M95259</link>
      <description>Hey&lt;BR /&gt;&lt;BR /&gt;bdf | grep /stand | awk ' { print $1" "$NF}'&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Mon, 26 Mar 2007 11:40:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/grep-how-to-exclude-fields/m-p/3969163#M95259</guid>
      <dc:creator>Oviwan</dc:creator>
      <dc:date>2007-03-26T11:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: grep - how to exclude fields ?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/grep-how-to-exclude-fields/m-p/3969164#M95260</link>
      <description>HI:&lt;BR /&gt;&lt;BR /&gt;The simple way:&lt;BR /&gt;&lt;BR /&gt;# bdf|grep -v -e /stand -e lvol1&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 26 Mar 2007 11:43:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/grep-how-to-exclude-fields/m-p/3969164#M95260</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-03-26T11:43:57Z</dc:date>
    </item>
    <item>
      <title>Re: grep - how to exclude fields ?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/grep-how-to-exclude-fields/m-p/3969165#M95261</link>
      <description>With grep you get whole lines.&lt;BR /&gt;No ifs or buts.&lt;BR /&gt;So grep needs help, typically awk or cut.&lt;BR /&gt;John K, shows a fine example of this helping.&lt;BR /&gt;&lt;BR /&gt;However, why not let awk (or perl) do it all?&lt;BR /&gt;&lt;BR /&gt;$ bdf | awk '/stand/ {print $1,$NF}'&lt;BR /&gt;&lt;BR /&gt;Also, somehow I'm thinking this is not your end goal. What problem are you really trying to solve ?!&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Hein.</description>
      <pubDate>Mon, 26 Mar 2007 12:46:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/grep-how-to-exclude-fields/m-p/3969165#M95261</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-03-26T12:46:12Z</dc:date>
    </item>
    <item>
      <title>Re: grep - how to exclude fields ?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/grep-how-to-exclude-fields/m-p/3969166#M95262</link>
      <description>... and to fix one other problem that you haven't yet anticipated, I suggest that you use bdfmegs rather than bdf. Bdfmegs is a Bill Hassell script that almost always outputs like bdf. The "almost always" is the significant part. Search the Forums for bdfmegs and you should have no trouble finding it.</description>
      <pubDate>Mon, 26 Mar 2007 12:55:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/grep-how-to-exclude-fields/m-p/3969166#M95262</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2007-03-26T12:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: grep - how to exclude fields ?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/grep-how-to-exclude-fields/m-p/3969167#M95263</link>
      <description>&lt;!--!*#--&gt;to get JUST the output:&lt;BR /&gt;&lt;BR /&gt;lvol1 stand&lt;BR /&gt;&lt;BR /&gt;run:&lt;BR /&gt;&lt;BR /&gt; bdf | grep /stand | sed -e "s/\// /g" -e "s/  */ /g" | cut -d " " -f 4,9&lt;BR /&gt;&lt;BR /&gt;Note: the first sed expression has a single space before the "/g",  and the second one has *two spaces* after the "s/" and a single space before the "/g".&lt;BR /&gt;&lt;BR /&gt;I'm guessing that since you know that /stand is in vg00 you're not interested in the whole /dev/vg00/lvol1 part of the string.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 26 Mar 2007 13:05:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/grep-how-to-exclude-fields/m-p/3969167#M95263</guid>
      <dc:creator>TwoProc</dc:creator>
      <dc:date>2007-03-26T13:05:08Z</dc:date>
    </item>
    <item>
      <title>Re: grep - how to exclude fields ?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/grep-how-to-exclude-fields/m-p/3969168#M95264</link>
      <description>Lots of ways to get that done, mainly because there are a number of sources for that information: commands "df" and  "bdf", as well as files "/etc/fstab" and "/etc/mnttab" .&lt;BR /&gt;&lt;BR /&gt;An easier one than the previous posting would be:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; df | grep stand | cut -b -15,33-42&lt;BR /&gt;&lt;BR /&gt;And actually &lt;BR /&gt;&amp;gt; df -n | grep stand&lt;BR /&gt;&lt;BR /&gt;gets you pretty close to what you asked for w/o stream edits.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;If you're wanting make sure to avoid the "bdf" line wrap problem indirectly mentioned in a previous posting use the contents /etc/mnttab instead:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; grep stand /etc/mnttab | cut -d "/" -f 4,5 | cut -d " " -f 1,2&lt;BR /&gt;&lt;BR /&gt;gives:&lt;BR /&gt;&lt;BR /&gt;lvol1 /stand&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 26 Mar 2007 13:39:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/grep-how-to-exclude-fields/m-p/3969168#M95264</guid>
      <dc:creator>TwoProc</dc:creator>
      <dc:date>2007-03-26T13:39:36Z</dc:date>
    </item>
  </channel>
</rss>

