Sponsored Content
Operating Systems OS X (Apple) Detect active usb device used by app Post 303037959 by Neo on Monday 19th of August 2019 11:27:10 PM
Old 08-20-2019
You can get this information with the macOS command:

Code:
system_profiler

See summary man page here:

https://www.unix.com/man-page/mojave/8/system_profiler/


Code:
root#  system_profiler -usage
Usage: system_profiler [-listDataTypes]
       system_profiler [-xml] [-timeout n] [-detailLevel n]
       system_profiler [-xml] [-timeout n] [dataType1 ... dataTypeN]

  -detailLevel n    specifies the level of detail for the report
                      mini = short report (contains no identifying or personal information)
                      basic = basic hardware and network information
                      full = all available information

  -listDataTypes    lists all the available datatypes

  -xml              generates xml output instead of plain text
                    if redirected to a file with the extension ".spx"
                    the file can be opened in System Profiler.app

  -timeout          specifies the maximum time to spend gathering information
                    the default is 180 seconds, 0 means no timeout

  Redirect stderr to /dev/null to suppress progress and error messages.

Examples:

  system_profiler
     Generates a text report with the standard detail level.

  system_profiler -detailLevel mini
     Generates a short report without identifying/personal information.

  system_profiler -listDataTypes
     Shows a list of the available data types.

  system_profiler SPSoftwareDataType SPNetworkDataType
     Generates a text report containing only software and network data.

  system_profiler -xml >MySystem.spx
     Creates a XML file which can be opened by System Profiler.app

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Can't detect usb thumbdrive anymore

hey everyone! i have a Solaris 8 box with me, and i had been using my usb thrumbdrive on it all the time. one day, i was in a rush and i pulled out the thumbdrive without ejecting it or anything. and now i can't detect any thumbdrives at all. i had tried using another thumbdrive, but with no... (2 Replies)
Discussion started by: feef
2 Replies

2. Windows & DOS: Issues & Discussions

How to detect if a Windows app dies??

Hello All: I hope this is the right category... I have a application (this app runs under java and jboss) that runs under Windows, it's started as a service. If that application should become disabled, crash or no longer function, what would be the best method for determining it is no longer... (6 Replies)
Discussion started by: jimmyc
6 Replies

3. Linux

mounting usb device

Hi Folks, I want to know how to mount usb device (cd,dvd etc) in linux, Regards, Manoj (4 Replies)
Discussion started by: manoj.solaris
4 Replies

4. Solaris

Usb Device

AM TRYING TO CONNECT A USB EXTERNAL DRIVE FOR BACKUP,THE USB SLOT IS AVAILABLE,BUT I DONT KNOW IF IT IS READY WHEN I CONNECT IT,AND WHAT COMMANDS DO I NEED. tHANKS (10 Replies)
Discussion started by: tomjones
10 Replies

5. Programming

How to detect usb storage arrival and its mount path from C

Hi, I am a newbi to linux, i wana to write a program in C that can detect arrival of a usb flash memory. I want also to find the actual mount point of new inserted flash disk. can anyone help me? thanks a lot (6 Replies)
Discussion started by: aghashahi
6 Replies

6. Shell Programming and Scripting

BASH Script to Detect and List USB Flash Drives

Hello. This is my first post to this forum. I've read many of the posts over the last two or three years and I've learned a lot. I'm creating a live Linux distribution using the Linux Live Scripts -- just as a hobby project -- and I'm wanting to create an automated way for a user to copy the... (7 Replies)
Discussion started by: godzillarama
7 Replies

7. Shell Programming and Scripting

Detect USB keyboard and other peripherals

Hi there, I have a Debian machine without any peripherals (no screen, no keyboard, etc.). I'd like to be able to detect and log when someone plugs a USB keyboard. Something like : 2009-07-04 12:21 warning: keyboard pluged! Is that possible? I see two ways : 1. Either actively react to the... (4 Replies)
Discussion started by: chebarbudo
4 Replies

8. Shell Programming and Scripting

script to detect a file from inserted usb and puts into a Variable

There is a same named log file that I have on my 2 different android phones. When I plug it into my computer, it appears in the media folder, For example the first android phone: /media/F6BA-0AF5/folder/A.log I want to put that into a variable to be manipulated.... (3 Replies)
Discussion started by: tobenguyen
3 Replies

9. UNIX for Advanced & Expert Users

USB Device Identification

In linux system when a pnp usb device is plugged in then how does the system gets a notification of it? I mean to say in linux usb system there is usb host controller above which is host controller driver above which is usb core. So does the host controller/usb core keeps on polling the usb bus... (1 Reply)
Discussion started by: rupeshkp728
1 Replies

10. UNIX for Advanced & Expert Users

Tar on usb device

Hi, i am developing an application on an ARM 7 architatcure with a small Linux. i want to run tar on a usb device (~10 Mb) but it runs realy slow. the command only takes 1% of cpu usage. is there a way to improve the tar command or is the USB-Connection the bottleneck here? (4 Replies)
Discussion started by: louisk
4 Replies
lsusb(8)							Linux USB Utilities							  lsusb(8)

NAME
lsusb - list USB devices SYNOPSIS
lsusb [ options ] DESCRIPTION
lsusb is a utility for displaying information about USB buses in the system and the devices connected to them. OPTIONS
-v, --verbose Tells lsusb to be verbose and display detailed information about the devices shown. This includes configuration descriptors for the device's current speed. Class descriptors will be shown, when available, for USB device classes including hub, audio, HID, communi- cations, and chipcard. -s [[bus]:][devnum] Show only devices in specified bus and/or devnum. Both ID's are given in decimal and may be omitted. -d [vendor]:[product] Show only devices with the specified vendor and product ID. Both ID's are given in hexadecimal. -D device Do not scan the /dev/bus/usb directory, instead display only information about the device whose device file is given. The device file should be something like /dev/bus/usb/001/001. This option displays detailed information like the v option; you must be root to do this. -t Tells lsusb to dump the physical USB device hierarchy as a tree. This overrides the v option. -V, --version Print version information on standard output, then exit successfully. RETURN VALUE
If the specified device is not found, a non-zero exit code is returned. FILES
/usr/share/hwdata/usb.ids A list of all known USB ID's (vendors, products, classes, subclasses and protocols). SEE ALSO
lspci(8), usbview(8). AUTHOR
Thomas Sailer, <sailer@ife.ee.ethz.ch>. usbutils-007 6 May 2009 lsusb(8)
All times are GMT -4. The time now is 05:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy