lshw学习——简单先容

[复制链接]
发表于 2025-12-3 00:29:31 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
简介

lshw: HardWare LiSter for Linux 一样平常用来查察linux装备的硬件信息,包罗内存、cpu、主板等信息。
  1. $ lshw --help
  2. Hardware Lister (lshw) -
  3. usage: lshw [-format] [-options ...]
  4.        lshw -version
  5.         -version        print program version ()
  6. format can be
  7.         -html           output hardware tree as HTML
  8.         -xml            output hardware tree as XML
  9.         -json           output hardware tree as a JSON object
  10.         -short          output hardware paths
  11.         -businfo        output bus information
  12. options can be
  13.         -class CLASS    only show a certain class of hardware
  14.         -C CLASS        same as '-class CLASS'
  15.         -c CLASS        same as '-class CLASS'
  16.         -disable TEST   disable a test (like pci, isapnp, cpuid, etc. )
  17.         -enable TEST    enable a test (like pci, isapnp, cpuid, etc. )
  18.         -quiet          don't display status
  19.         -sanitize       sanitize output (remove sensitive information like serial numbers, etc.)
  20.         -numeric        output numeric IDs (for PCI, USB, etc.)
  21.         -notime         exclude volatile attributes (timestamps) from output
复制代码
代码:https://ezix.org/src/pkg/lshw.git
核心结构

  1. class hwNode
  2. {
  3.    
  4.    
  5.   public:
  6.     hwNode(const string & id,
  7.       hw::hwClass c = hw::generic,
  8.       const string & vendor = "",
  9.       const string & product = "",
  10.       const string & version = "");
  11.     hwNode(const hwNode & o);
  12.     ~hwNode();
  13.     hwNode & operator =(const hwNode & o);
  14.     string getId() const;
  15.     void setHandle(const string & handle);
  16.     string getHandle() const;
  17.     bool enabled() const;
  18.     bool disabled() const;
  19.     void enable();
  20.     void disable();
  21.     bool claimed() const;
  22.     void claim(bool claimchildren=false);
  23.     void unclaim();
  24.     hw::hwClass getClass() const;
  25.     const char * getClassName() const;
  26.     void setClass(hw::hwClass c);
  27.     string getDescription() const;
  28.     void setDescription(const string & description)
复制代码
回复

使用道具 举报

登录后关闭弹窗

登录参与点评抽奖  加入IT实名职场社区
去登录
快速回复 返回顶部 返回列表