Welcome to the Linux Foundation Forum!

Ports and hardware parts names? service pci usb lsof lspci lsusb

Here does linux generally keeps this kind of info?

I know is kept in a file somewhere...!

Where is located in Debian?

Like when you type lsof , lspci , lsusb and it shows all that info about the part / manufacturer

Especially lsof that "resolve" port service names (like ssh ... www)

Ports and hardware parts names? service pci usb lsof lspci lsusb


  • Goineasy9
    Goineasy9 Posts: 1,114
    This info is kept in many places. Go into the /proc folder for example (you might need to be root in order to read the contents of files), and open any folder or file and look at the contents.

    /proc/meminfo etc., etc., etc.

    Some info comes from the /etc folder, some from the /usr folder and some comes from the config files in your own /home folder.

    The utilities you mention gather the info and print it out for you. If you're interested in finding out exactly where each bit of info comes from, download the source code of any of the utilities and go though it line by line and see where the code takes you. I use "inxi" to print out my hardware info. Reading the code for "inxi" is easier because it's commented so thoroughly.

    If you would like to look through the code of "inxi" you can obtain it with:
    wget -Nc smxi.org/inxi

    If you want to install it to see what it does:
    Do, as root:
    cd /usr/local/bin
    wget -Nc smxi.org/inxi
    chmod +x inxi
    chmod (your_user_name) inxi

    Then type inxi -F in a terminal, or inxi -h if you want to see more options.
  • woboyle
    woboyle Posts: 501
    As GoinEasy9 said, it is in a number of places, but the main one is in /proc for current systems. This is where the system registers hardware so that tools like lspci et al can easily report what the system sees, without resorting to time-consuming and error-prone physical hardware interrogation.
  • elbriga
    elbriga Posts: 3
    I think I didn't make myself clear...

    The thing I really want to know where is the data for "resolving" port names.

    Like: where lsof will go to translate "80" into "www", "22" into "ssh", and so on...

    I've checked the lsof source, but didn manage to find where it pulls this info from...
  • woboyle
    woboyle Posts: 501
    Ah! Look in /etc/services
  • elbriga
    elbriga Posts: 3
    alright! thanks


Upcoming Training