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











up vote
3
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
    3
    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
      3
      down vote

      favorite









      up vote
      3
      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 Dec 2 at 21:55









      Rui F Ribeiro

      38.5k1479128




      38.5k1479128










      asked Dec 2 at 20:10









      Thoughtcraft

      1569




      1569






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          8
          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
            Dec 2 at 20:22






          • 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
            Dec 2 at 21:06












          • Awesome, if I want to go deeper I can keep adding stars like: tree -d -R /sys/class/hwmon/*/*/ */*
            – Thoughtcraft
            Dec 2 at 21:14










          • Might want to check for infinite loops.
            – Joshua
            Dec 3 at 0:48






          • 1




            @Joshua tree -l does that on its own.
            – Stephen Kitt
            Dec 3 at 5:13











          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
          8
          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
            Dec 2 at 20:22






          • 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
            Dec 2 at 21:06












          • Awesome, if I want to go deeper I can keep adding stars like: tree -d -R /sys/class/hwmon/*/*/ */*
            – Thoughtcraft
            Dec 2 at 21:14










          • Might want to check for infinite loops.
            – Joshua
            Dec 3 at 0:48






          • 1




            @Joshua tree -l does that on its own.
            – Stephen Kitt
            Dec 3 at 5:13















          up vote
          8
          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
            Dec 2 at 20:22






          • 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
            Dec 2 at 21:06












          • Awesome, if I want to go deeper I can keep adding stars like: tree -d -R /sys/class/hwmon/*/*/ */*
            – Thoughtcraft
            Dec 2 at 21:14










          • Might want to check for infinite loops.
            – Joshua
            Dec 3 at 0:48






          • 1




            @Joshua tree -l does that on its own.
            – Stephen Kitt
            Dec 3 at 5:13













          up vote
          8
          down vote



          accepted







          up vote
          8
          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 Dec 2 at 20:19









          Stephen Kitt

          160k24357432




          160k24357432












          • 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
            Dec 2 at 20:22






          • 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
            Dec 2 at 21:06












          • Awesome, if I want to go deeper I can keep adding stars like: tree -d -R /sys/class/hwmon/*/*/ */*
            – Thoughtcraft
            Dec 2 at 21:14










          • Might want to check for infinite loops.
            – Joshua
            Dec 3 at 0:48






          • 1




            @Joshua tree -l does that on its own.
            – Stephen Kitt
            Dec 3 at 5:13


















          • 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
            Dec 2 at 20:22






          • 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
            Dec 2 at 21:06












          • Awesome, if I want to go deeper I can keep adding stars like: tree -d -R /sys/class/hwmon/*/*/ */*
            – Thoughtcraft
            Dec 2 at 21:14










          • Might want to check for infinite loops.
            – Joshua
            Dec 3 at 0:48






          • 1




            @Joshua tree -l does that on its own.
            – Stephen Kitt
            Dec 3 at 5:13
















          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
          Dec 2 at 20:22




          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
          Dec 2 at 20:22




          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
          Dec 2 at 21:06






          @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
          Dec 2 at 21:06














          Awesome, if I want to go deeper I can keep adding stars like: tree -d -R /sys/class/hwmon/*/*/ */*
          – Thoughtcraft
          Dec 2 at 21:14




          Awesome, if I want to go deeper I can keep adding stars like: tree -d -R /sys/class/hwmon/*/*/ */*
          – Thoughtcraft
          Dec 2 at 21:14












          Might want to check for infinite loops.
          – Joshua
          Dec 3 at 0:48




          Might want to check for infinite loops.
          – Joshua
          Dec 3 at 0:48




          1




          1




          @Joshua tree -l does that on its own.
          – Stephen Kitt
          Dec 3 at 5:13




          @Joshua tree -l does that on its own.
          – Stephen Kitt
          Dec 3 at 5:13


















          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

          How to change which sound is reproduced for terminal bell?

          Can I use Tabulator js library in my java Spring + Thymeleaf project?

          Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents