{"id":33,"date":"2007-11-28T12:54:34","date_gmt":"2007-11-28T09:54:34","guid":{"rendered":"http:\/\/www.held.org.il\/blog\/?p=33"},"modified":"2007-11-28T12:54:34","modified_gmt":"2007-11-28T09:54:34","slug":"which-driver-is-my-eth0-using","status":"publish","type":"post","link":"http:\/\/www.held.org.il\/blog\/2007\/11\/which-driver-is-my-eth0-using\/","title":{"rendered":"Which driver is my eth0 using?"},"content":{"rendered":"<p>Danny made a cool cmd line to find out the driver a specific network interface is using:<\/p>\n<blockquote><p> ls -l \/sys\/class\/net\/<strong>eth0<\/strong>\/device\/driver\/|grep module|awk -F \"\/\" '{print $NF}'<\/p><\/blockquote>\n<p>Then I thought, why trust the <em>ls<\/em> output.. Then I found the <em>\/usr\/bin\/readlink<\/em> command, so:<\/p>\n<blockquote><p>readlink \/sys\/class\/net\/<strong>eth0<\/strong>\/device\/driver\/module|awk -F \"\/\" '{print $NF}'<\/p><\/blockquote>\n<p>Now, I hate awk, so why not use <em>basename<\/em>:<\/p>\n<blockquote><p>basename `readlink \/sys\/class\/net\/<strong>eth0<\/strong>\/device\/driver\/module`<\/p><\/blockquote>\n<p>\/sys is cool.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Danny made a cool cmd line to find out the driver a specific network interface is using: ls -l \/sys\/class\/net\/eth0\/device\/driver\/|grep module|awk -F &#8220;\/&#8221; &#8216;{print $NF}&#8217; Then I thought, why trust the ls output.. Then I found the \/usr\/bin\/readlink command, so: readlink \/sys\/class\/net\/eth0\/device\/driver\/module|awk -F &#8220;\/&#8221; &#8216;{print $NF}&#8217; Now, I hate awk, so why not use basename: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[75],"tags":[],"_links":{"self":[{"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/posts\/33"}],"collection":[{"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/comments?post=33"}],"version-history":[{"count":0,"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/posts\/33\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/media?parent=33"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/categories?post=33"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/tags?post=33"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}