Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 199901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T17:03:51+00:00 2026-05-11T17:03:51+00:00

In a Linux environment, I need to detect the physical connected or disconnected state

  • 0

In a Linux environment, I need to detect the physical connected or disconnected state of an RJ45 connector to its socket. Preferably using BASH scripting only.

The following solutions which have been proposed on other sites do NOT work for this purpose:

  1. Using ‘ifconfig’ – since a network cable may be connected but the network not properly configured or not currently up.
  2. Ping a host – since the product will be within a LAN using an unknown network configuration and unknown hosts.

Isn’t there some state which can be used in the /proc file system (everything else is in there)?

How is the Linux world suppose to have their own version of the Windows bubble that pop up from the icon tray indicating that you’ve just unplugged the network cable?


Kent Fredric and lothar, both of your answers satisfy my need… thanks a lot! Which one I’ll use… I still don’t know.

I guess I can’t put you both down as the correct answer? And its probably fair for you that I do choose one. Flip a coin I guess? Again, thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T17:03:51+00:00Added an answer on May 11, 2026 at 5:03 pm

    You want to look at the nodes in

    /sys/class/net/
    

    I experimented with mine:

    Wire Plugged in:

    eth0/carrier:1
    eth0/operstate:unknown
    

    Wire Removed:

    eth0/carrier:0
    eth0/operstate:down
    

    Wire Plugged in Again:

    eth0/carrier:1
    eth0/operstate:up
    

    Side Trick: harvesting all properties at once the easy way:

    grep "" eth0/* 
    

    This forms a nice list of key:value pairs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 120k
  • Answers 120k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Conversation scope sounds right. What's the problem with starting a… May 12, 2026 at 12:09 am
  • Editorial Team
    Editorial Team added an answer You are iterating over the groups when you should be… May 12, 2026 at 12:09 am
  • Editorial Team
    Editorial Team added an answer jQuery's clone method explicitly removes the data() values from the… May 12, 2026 at 12:09 am

Related Questions

I'm looking for way to PHP to detect if a script was run from
I need to detect whether my Makefile is running under valgrind (indirectly, using valgrind
I've seen a good bit of setuptools bashing on the internets lately. Most recently,
I am currently constructing a Carputer front end and one function that it needs

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.