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.

Terminal window
lsbom [options] [parameter]
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
ParameterDescription
bom-filePath to the Bill Of Materials (BOM) file
Terminal window
lsbom -pf /Library/Receipts/InstallHistory.bom

Displays the contents of the specified package file.

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

Lists all the files contained in the specified package file.

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

Verifies the integrity of the specified package file.

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

Extracts the contents of the specified package file.

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

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

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

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

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

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

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

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

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?

Section titled “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?

Section titled “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?

Section titled “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?

Section titled “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?

Section titled “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?

Section titled “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?

Section titled “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
  • Checking the contents of a .bom file
  • Verifying package contents during installation
  • Troubleshooting package installation issues
  • Extracting information about installed packages