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

Related Questions

In Linux When I invoke python from the shell it replicates its environment, and
I would like to develop Adobe Flex applications using Linux and a free environment.
I'm working in a Linux environment with C++, using the GCC compiler. I'm currently
I need to detect whether my Makefile is running under valgrind (indirectly, using valgrind
Actually I have a file . I am working in linux environment. I need
In a Linux environment working in C++, I need to convert a time_t value
I am working in the Linux environment, and I have a C++ program, what
I have an existing C++ project on a linux environment, and would like to
On linux, it's possible to create a tun interface using a tun driver which
Under Linux, my C++ application is using fork() and execv() to launch multiple instances

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.