grep

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mubs
    New Member
    • Mar 2007
    • 77

    #1

    grep

    does any1 know the grep command to display:


    IP address
    Subnet mask
    Network Interface Card physical address
    The current status of the NIC.
    Details held in the /etc/hosts
  • sicarie
    Recognized Expert Specialist
    • Nov 2006
    • 4677

    #2
    Originally posted by Mubs
    does any1 know the grep command to display:


    IP address
    Subnet mask
    Network Interface Card physical address
    The current status of the NIC.
    Details held in the /etc/hosts
    I wouldn't use grep for those, I'd use the other commands that display them directly.

    That's a rather specific question/list, is this a homework question? If so, what have you tried?

    Comment

    • Mubs
      New Member
      • Mar 2007
      • 77

      #3
      Originally posted by sicarie
      I wouldn't use grep for those, I'd use the other commands that display them directly.

      That's a rather specific question/list, is this a homework question? If so, what have you tried?
      ive tried ifconfig but i need the individual data

      Comment

      • sicarie
        Recognized Expert Specialist
        • Nov 2006
        • 4677

        #4
        Originally posted by Mubs
        ive tried ifconfig but i need the individual data
        What do you mean, "the individual data"? For a separate interface? Did you try checking the manpage for ifconfig?

        Comment

        • DaiTengu
          Banned
          New Member
          • Mar 2007
          • 12

          #5
          grep merely searches, and outputs info it finds from whatever you feed it. It's probably no help here.

          ifconfig should give you 95% of what you're looking for.

          Are you looking to have it nicely formatted or something? You'll probably need to write a bash or perl script to do that.

          Comment

          • Motoma
            Recognized Expert Specialist
            • Jan 2007
            • 3236

            #6
            Originally posted by Mubs
            does any1 know the grep command to display:


            IP address
            Subnet mask
            Network Interface Card physical address
            The current status of the NIC.
            Details held in the /etc/hosts
            I would use ifconfig and pipe the results through sed.

            Comment

            • DaiTengu
              Banned
              New Member
              • Mar 2007
              • 12

              #7
              Originally posted by Motoma
              I would use ifconfig and pipe the results through sed.
              Still doesn't get the info he needs from /etc/hosts. It'd require a couple commands, or a small script to do that.

              Comment

              Working...