Why can't tree fully list /sys/class/hwmon? And how could I do that?











up vote
2
down vote

favorite












If I understand correctly, in Linux, everything is a path, right down to each piece of hardware. I am trying to get information about how my sensors are structured, so I thought I would just use tree to map out all the things in my hwmon directory. However, tree does not behave the same with this directory as I am accustomed to.



When I run tree on a normal directory, I get the subdirectory structure without using the -R or -L flags:



$ tree /home
/home
└── boss
├── clones
├── Desktop
├── Documents
│   ├── modules.txt
│   ├── old_docs
│   │   └── assorted
│   └── prepscript.txt
├── Downloads
├── Music
├── Pictures
├── Public
├── Templates
└── Videos

12 directories, 2 files


but I try to do the same with HWmon, it only goes one level deep, even if I do use the -R flag and even though there is stuff deeper:



$ tree /sys/class/hwmon/
/sys/class/hwmon/
├── hwmon0 -> ../../devices/pci0000:40/0000:40:01.3/0000:43:00.0/hwmon/hwmon0
├── hwmon1 -> ../../devices/pci0000:00/0000:00:01.3/0000:09:00.0/hwmon/hwmon1
├── hwmon2 -> ../../devices/pci0000:40/0000:40:03.1/0000:44:00.0/hwmon/hwmon2
├── hwmon3 -> ../../devices/pci0000:00/0000:00:18.3/hwmon/hwmon3
├── hwmon4 -> ../../devices/pci0000:00/0000:00:19.3/hwmon/hwmon4
├── hwmon5 -> ../../devices/virtual/thermal/thermal_zone0/hwmon5
└── hwmon6 -> ../../devices/platform/nct6775.656/hwmon/hwmon6

7 directories, 0 files
$ tree /sys/class/hwmon/hwmon0
/sys/class/hwmon/hwmon0
├── device -> ../../../0000:43:00.0
├── fan1_input
├── name
├── power
│   ├── async
│   ├── autosuspend_delay_ms
│   ├── control
│   ├── runtime_active_kids
│   ├── runtime_active_time
│   ├── runtime_enabled
│   ├── runtime_status
│   ├── runtime_suspended_time
│   └── runtime_usage
├── pwm1
├── pwm1_enable
├── pwm1_max
├── pwm1_min
├── subsystem -> ../../../../../../class/hwmon
├── temp1_auto_point1_pwm
├── temp1_auto_point1_temp
├── temp1_auto_point1_temp_hyst
├── temp1_crit
├── temp1_crit_hyst
├── temp1_emergency
├── temp1_emergency_hyst
├── temp1_input
├── temp1_max
├── temp1_max_hyst
├── uevent
└── update_interval

3 directories, 27 files


What causes this difference in behavior, and can I just get a simple tree of all the devices?










share|improve this question




























    up vote
    2
    down vote

    favorite












    If I understand correctly, in Linux, everything is a path, right down to each piece of hardware. I am trying to get information about how my sensors are structured, so I thought I would just use tree to map out all the things in my hwmon directory. However, tree does not behave the same with this directory as I am accustomed to.



    When I run tree on a normal directory, I get the subdirectory structure without using the -R or -L flags:



    $ tree /home
    /home
    └── boss
    ├── clones
    ├── Desktop
    ├── Documents
    │   ├── modules.txt
    │   ├── old_docs
    │   │   └── assorted
    │   └── prepscript.txt
    ├── Downloads
    ├── Music
    ├── Pictures
    ├── Public
    ├── Templates
    └── Videos

    12 directories, 2 files


    but I try to do the same with HWmon, it only goes one level deep, even if I do use the -R flag and even though there is stuff deeper:



    $ tree /sys/class/hwmon/
    /sys/class/hwmon/
    ├── hwmon0 -> ../../devices/pci0000:40/0000:40:01.3/0000:43:00.0/hwmon/hwmon0
    ├── hwmon1 -> ../../devices/pci0000:00/0000:00:01.3/0000:09:00.0/hwmon/hwmon1
    ├── hwmon2 -> ../../devices/pci0000:40/0000:40:03.1/0000:44:00.0/hwmon/hwmon2
    ├── hwmon3 -> ../../devices/pci0000:00/0000:00:18.3/hwmon/hwmon3
    ├── hwmon4 -> ../../devices/pci0000:00/0000:00:19.3/hwmon/hwmon4
    ├── hwmon5 -> ../../devices/virtual/thermal/thermal_zone0/hwmon5
    └── hwmon6 -> ../../devices/platform/nct6775.656/hwmon/hwmon6

    7 directories, 0 files
    $ tree /sys/class/hwmon/hwmon0
    /sys/class/hwmon/hwmon0
    ├── device -> ../../../0000:43:00.0
    ├── fan1_input
    ├── name
    ├── power
    │   ├── async
    │   ├── autosuspend_delay_ms
    │   ├── control
    │   ├── runtime_active_kids
    │   ├── runtime_active_time
    │   ├── runtime_enabled
    │   ├── runtime_status
    │   ├── runtime_suspended_time
    │   └── runtime_usage
    ├── pwm1
    ├── pwm1_enable
    ├── pwm1_max
    ├── pwm1_min
    ├── subsystem -> ../../../../../../class/hwmon
    ├── temp1_auto_point1_pwm
    ├── temp1_auto_point1_temp
    ├── temp1_auto_point1_temp_hyst
    ├── temp1_crit
    ├── temp1_crit_hyst
    ├── temp1_emergency
    ├── temp1_emergency_hyst
    ├── temp1_input
    ├── temp1_max
    ├── temp1_max_hyst
    ├── uevent
    └── update_interval

    3 directories, 27 files


    What causes this difference in behavior, and can I just get a simple tree of all the devices?










    share|improve this question


























      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      If I understand correctly, in Linux, everything is a path, right down to each piece of hardware. I am trying to get information about how my sensors are structured, so I thought I would just use tree to map out all the things in my hwmon directory. However, tree does not behave the same with this directory as I am accustomed to.



      When I run tree on a normal directory, I get the subdirectory structure without using the -R or -L flags:



      $ tree /home
      /home
      └── boss
      ├── clones
      ├── Desktop
      ├── Documents
      │   ├── modules.txt
      │   ├── old_docs
      │   │   └── assorted
      │   └── prepscript.txt
      ├── Downloads
      ├── Music
      ├── Pictures
      ├── Public
      ├── Templates
      └── Videos

      12 directories, 2 files


      but I try to do the same with HWmon, it only goes one level deep, even if I do use the -R flag and even though there is stuff deeper:



      $ tree /sys/class/hwmon/
      /sys/class/hwmon/
      ├── hwmon0 -> ../../devices/pci0000:40/0000:40:01.3/0000:43:00.0/hwmon/hwmon0
      ├── hwmon1 -> ../../devices/pci0000:00/0000:00:01.3/0000:09:00.0/hwmon/hwmon1
      ├── hwmon2 -> ../../devices/pci0000:40/0000:40:03.1/0000:44:00.0/hwmon/hwmon2
      ├── hwmon3 -> ../../devices/pci0000:00/0000:00:18.3/hwmon/hwmon3
      ├── hwmon4 -> ../../devices/pci0000:00/0000:00:19.3/hwmon/hwmon4
      ├── hwmon5 -> ../../devices/virtual/thermal/thermal_zone0/hwmon5
      └── hwmon6 -> ../../devices/platform/nct6775.656/hwmon/hwmon6

      7 directories, 0 files
      $ tree /sys/class/hwmon/hwmon0
      /sys/class/hwmon/hwmon0
      ├── device -> ../../../0000:43:00.0
      ├── fan1_input
      ├── name
      ├── power
      │   ├── async
      │   ├── autosuspend_delay_ms
      │   ├── control
      │   ├── runtime_active_kids
      │   ├── runtime_active_time
      │   ├── runtime_enabled
      │   ├── runtime_status
      │   ├── runtime_suspended_time
      │   └── runtime_usage
      ├── pwm1
      ├── pwm1_enable
      ├── pwm1_max
      ├── pwm1_min
      ├── subsystem -> ../../../../../../class/hwmon
      ├── temp1_auto_point1_pwm
      ├── temp1_auto_point1_temp
      ├── temp1_auto_point1_temp_hyst
      ├── temp1_crit
      ├── temp1_crit_hyst
      ├── temp1_emergency
      ├── temp1_emergency_hyst
      ├── temp1_input
      ├── temp1_max
      ├── temp1_max_hyst
      ├── uevent
      └── update_interval

      3 directories, 27 files


      What causes this difference in behavior, and can I just get a simple tree of all the devices?










      share|improve this question















      If I understand correctly, in Linux, everything is a path, right down to each piece of hardware. I am trying to get information about how my sensors are structured, so I thought I would just use tree to map out all the things in my hwmon directory. However, tree does not behave the same with this directory as I am accustomed to.



      When I run tree on a normal directory, I get the subdirectory structure without using the -R or -L flags:



      $ tree /home
      /home
      └── boss
      ├── clones
      ├── Desktop
      ├── Documents
      │   ├── modules.txt
      │   ├── old_docs
      │   │   └── assorted
      │   └── prepscript.txt
      ├── Downloads
      ├── Music
      ├── Pictures
      ├── Public
      ├── Templates
      └── Videos

      12 directories, 2 files


      but I try to do the same with HWmon, it only goes one level deep, even if I do use the -R flag and even though there is stuff deeper:



      $ tree /sys/class/hwmon/
      /sys/class/hwmon/
      ├── hwmon0 -> ../../devices/pci0000:40/0000:40:01.3/0000:43:00.0/hwmon/hwmon0
      ├── hwmon1 -> ../../devices/pci0000:00/0000:00:01.3/0000:09:00.0/hwmon/hwmon1
      ├── hwmon2 -> ../../devices/pci0000:40/0000:40:03.1/0000:44:00.0/hwmon/hwmon2
      ├── hwmon3 -> ../../devices/pci0000:00/0000:00:18.3/hwmon/hwmon3
      ├── hwmon4 -> ../../devices/pci0000:00/0000:00:19.3/hwmon/hwmon4
      ├── hwmon5 -> ../../devices/virtual/thermal/thermal_zone0/hwmon5
      └── hwmon6 -> ../../devices/platform/nct6775.656/hwmon/hwmon6

      7 directories, 0 files
      $ tree /sys/class/hwmon/hwmon0
      /sys/class/hwmon/hwmon0
      ├── device -> ../../../0000:43:00.0
      ├── fan1_input
      ├── name
      ├── power
      │   ├── async
      │   ├── autosuspend_delay_ms
      │   ├── control
      │   ├── runtime_active_kids
      │   ├── runtime_active_time
      │   ├── runtime_enabled
      │   ├── runtime_status
      │   ├── runtime_suspended_time
      │   └── runtime_usage
      ├── pwm1
      ├── pwm1_enable
      ├── pwm1_max
      ├── pwm1_min
      ├── subsystem -> ../../../../../../class/hwmon
      ├── temp1_auto_point1_pwm
      ├── temp1_auto_point1_temp
      ├── temp1_auto_point1_temp_hyst
      ├── temp1_crit
      ├── temp1_crit_hyst
      ├── temp1_emergency
      ├── temp1_emergency_hyst
      ├── temp1_input
      ├── temp1_max
      ├── temp1_max_hyst
      ├── uevent
      └── update_interval

      3 directories, 27 files


      What causes this difference in behavior, and can I just get a simple tree of all the devices?







      sysfs tree sensors






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 4 hours ago









      Rui F Ribeiro

      38.3k1476127




      38.3k1476127










      asked 5 hours ago









      Thoughtcraft

      1368




      1368






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          5
          down vote



          accepted










          tree behaves that way because it doesn’t dereference symlinks by default. The -l option will change that:



          tree -l /sys/class/hwmon/


          but you’ll have fun making sense of all the output.






          share|improve this answer





















          • Wow, that is indeed some confusing output. Is there a way to get the structure as it would appear if I browsed through it?
            – Thoughtcraft
            5 hours ago






          • 2




            @Thoughtcraft the problem is mostly because the device link goes up the tree (to the parent device), therefore this command shows the entire device tree, not just a few subtrees. I guess you can do e.g. tree -d /sys/class/hwmon/*/ to show the directory structure and symlinks to directories, and chase the device links yourself.
            – sourcejedi
            4 hours ago












          • Awesome, if I want to go deeper I can keep adding stars like: tree -d -R /sys/class/hwmon/*/*/ */*
            – Thoughtcraft
            4 hours ago










          • Might want to check for infinite loops.
            – Joshua
            1 hour ago











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "106"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f485548%2fwhy-cant-tree-fully-list-sys-class-hwmon-and-how-could-i-do-that%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          5
          down vote



          accepted










          tree behaves that way because it doesn’t dereference symlinks by default. The -l option will change that:



          tree -l /sys/class/hwmon/


          but you’ll have fun making sense of all the output.






          share|improve this answer





















          • Wow, that is indeed some confusing output. Is there a way to get the structure as it would appear if I browsed through it?
            – Thoughtcraft
            5 hours ago






          • 2




            @Thoughtcraft the problem is mostly because the device link goes up the tree (to the parent device), therefore this command shows the entire device tree, not just a few subtrees. I guess you can do e.g. tree -d /sys/class/hwmon/*/ to show the directory structure and symlinks to directories, and chase the device links yourself.
            – sourcejedi
            4 hours ago












          • Awesome, if I want to go deeper I can keep adding stars like: tree -d -R /sys/class/hwmon/*/*/ */*
            – Thoughtcraft
            4 hours ago










          • Might want to check for infinite loops.
            – Joshua
            1 hour ago















          up vote
          5
          down vote



          accepted










          tree behaves that way because it doesn’t dereference symlinks by default. The -l option will change that:



          tree -l /sys/class/hwmon/


          but you’ll have fun making sense of all the output.






          share|improve this answer





















          • Wow, that is indeed some confusing output. Is there a way to get the structure as it would appear if I browsed through it?
            – Thoughtcraft
            5 hours ago






          • 2




            @Thoughtcraft the problem is mostly because the device link goes up the tree (to the parent device), therefore this command shows the entire device tree, not just a few subtrees. I guess you can do e.g. tree -d /sys/class/hwmon/*/ to show the directory structure and symlinks to directories, and chase the device links yourself.
            – sourcejedi
            4 hours ago












          • Awesome, if I want to go deeper I can keep adding stars like: tree -d -R /sys/class/hwmon/*/*/ */*
            – Thoughtcraft
            4 hours ago










          • Might want to check for infinite loops.
            – Joshua
            1 hour ago













          up vote
          5
          down vote



          accepted







          up vote
          5
          down vote



          accepted






          tree behaves that way because it doesn’t dereference symlinks by default. The -l option will change that:



          tree -l /sys/class/hwmon/


          but you’ll have fun making sense of all the output.






          share|improve this answer












          tree behaves that way because it doesn’t dereference symlinks by default. The -l option will change that:



          tree -l /sys/class/hwmon/


          but you’ll have fun making sense of all the output.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 5 hours ago









          Stephen Kitt

          159k24356431




          159k24356431












          • Wow, that is indeed some confusing output. Is there a way to get the structure as it would appear if I browsed through it?
            – Thoughtcraft
            5 hours ago






          • 2




            @Thoughtcraft the problem is mostly because the device link goes up the tree (to the parent device), therefore this command shows the entire device tree, not just a few subtrees. I guess you can do e.g. tree -d /sys/class/hwmon/*/ to show the directory structure and symlinks to directories, and chase the device links yourself.
            – sourcejedi
            4 hours ago












          • Awesome, if I want to go deeper I can keep adding stars like: tree -d -R /sys/class/hwmon/*/*/ */*
            – Thoughtcraft
            4 hours ago










          • Might want to check for infinite loops.
            – Joshua
            1 hour ago


















          • Wow, that is indeed some confusing output. Is there a way to get the structure as it would appear if I browsed through it?
            – Thoughtcraft
            5 hours ago






          • 2




            @Thoughtcraft the problem is mostly because the device link goes up the tree (to the parent device), therefore this command shows the entire device tree, not just a few subtrees. I guess you can do e.g. tree -d /sys/class/hwmon/*/ to show the directory structure and symlinks to directories, and chase the device links yourself.
            – sourcejedi
            4 hours ago












          • Awesome, if I want to go deeper I can keep adding stars like: tree -d -R /sys/class/hwmon/*/*/ */*
            – Thoughtcraft
            4 hours ago










          • Might want to check for infinite loops.
            – Joshua
            1 hour ago
















          Wow, that is indeed some confusing output. Is there a way to get the structure as it would appear if I browsed through it?
          – Thoughtcraft
          5 hours ago




          Wow, that is indeed some confusing output. Is there a way to get the structure as it would appear if I browsed through it?
          – Thoughtcraft
          5 hours ago




          2




          2




          @Thoughtcraft the problem is mostly because the device link goes up the tree (to the parent device), therefore this command shows the entire device tree, not just a few subtrees. I guess you can do e.g. tree -d /sys/class/hwmon/*/ to show the directory structure and symlinks to directories, and chase the device links yourself.
          – sourcejedi
          4 hours ago






          @Thoughtcraft the problem is mostly because the device link goes up the tree (to the parent device), therefore this command shows the entire device tree, not just a few subtrees. I guess you can do e.g. tree -d /sys/class/hwmon/*/ to show the directory structure and symlinks to directories, and chase the device links yourself.
          – sourcejedi
          4 hours ago














          Awesome, if I want to go deeper I can keep adding stars like: tree -d -R /sys/class/hwmon/*/*/ */*
          – Thoughtcraft
          4 hours ago




          Awesome, if I want to go deeper I can keep adding stars like: tree -d -R /sys/class/hwmon/*/*/ */*
          – Thoughtcraft
          4 hours ago












          Might want to check for infinite loops.
          – Joshua
          1 hour ago




          Might want to check for infinite loops.
          – Joshua
          1 hour ago


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Unix & Linux Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f485548%2fwhy-cant-tree-fully-list-sys-class-hwmon-and-how-could-i-do-that%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Entries order in /etc/network/interfaces

          新発田市

          Grub takes very long (several minutes) to open Menu (in Multi-Boot-System)