Skip to content

lsbom command in MacOS

The MacOS lsbom command allows users to list the contents of Bill of Materials (BOM) files, providing detailed information about installed packages. By running lsbom with various options, users can navigate, inspect, and analyze BOM files to gain insights into the package installations on their system. This command is valuable for troubleshooting, verifying installations, and understanding package dependencies on MacOS.

lsbom Syntax:

Terminal window
lsbom [options] [parameter]

MacOS lsbom Options:

OptionDescription
-lList files in the package
-pDisplay full path of files
-sDisplay size of files
-fDisplay file flags
-dDisplay directories within the package
-tDisplay file modification times
-vVerbose mode (for debugging)
-PDisplay package payload

lsbom Parameters:

ParameterDescription
bom-filePath to the Bill Of Materials (BOM) file

How to use lsbom command:

Display Package Contents

Terminal window
lsbom -pf /Library/Receipts/InstallHistory.bom

Displays the contents of the specified package file.

List Files in Package

Terminal window
lsbom -l /Library/Receipts/InstallHistory.bom

Lists all the files contained in the specified package file.

Verify Package Integrity

Terminal window
lsbom -v /Library/Receipts/InstallHistory.bom

Verifies the integrity of the specified package file.

Extract Package Content

Terminal window
lsbom -s /Library/Receipts/InstallHistory.bom | cpio -id

Extracts the contents of the specified package file.

Display Package Ownership

Terminal window
lsbom -o /Library/Receipts/InstallHistory.bom

Displays the ownership details of the files in the specified package file.

Filter Specific Files

Terminal window
lsbom -ls /Library/Receipts/InstallHistory.bom | grep -i 'readme'

Filters and displays only the files containing ‘readme’ in the specified package file.

List Package Contents with Details

Terminal window
lsbom -lv /Library/Receipts/InstallHistory.bom

Lists the files and their details in the specified package file.

Check Package Subdirectories

Terminal window
lsbom -X /Library/Receipts/InstallHistory.bom

Checks for the presence of subdirectories in the specified package file.

How do I use lsbom in MacOS?

To use the lsbom command in MacOS, execute the following command:

Terminal window
lsbom -f package.bom

What is the purpose of the lsbom command in MacOS?

The lsbom command in MacOS is used to list the contents of the Bill of Materials (BOM) files associated with packages.

How can I display the contents of a specific Bill of Materials file using lsbom?

To display the content of a specific Bill of Materials file using lsbom, use the following command:

Terminal window
lsbom -l package.bom

How do I extract the paths from a Bill of Materials file with lsbom?

To extract the paths from a Bill of Materials file using lsbom, run the following command:

Terminal window
lsbom -p package.bom

Can lsbom be used to verify package installations in MacOS?

Yes, lsbom can be used to verify package installations in MacOS by comparing the files installed on the system against the Bill of Materials files associated with the packages.

How do I check the ownership and permissions of files listed in a Bill of Materials file with lsbom?

To check the ownership and permissions of files listed in a Bill of Materials file using lsbom, execute the following command:

Terminal window
lsbom -p list.bom | xargs -n 1 -I {} stat -f "%u %g %p {}"

Is it possible to list the directories contained in a Bill of Materials file using lsbom?

Yes, it is possible to list the directories contained in a Bill of Materials file using lsbom. You can achieve this by running the following command:

Terminal window
lsbom -d package.bom

How do I use lsbom to verify package installations against Bill of Materials files in a directory?

To verify package installations against Bill of Materials files in a directory using lsbom, you can use the following command:

Terminal window
lsbom -s /Library/Receipts

Applications of the lsbom command

  • Checking the contents of a .bom file
  • Verifying package contents during installation
  • Troubleshooting package installation issues
  • Extracting information about installed packages