On Mon, 27 Jan 2025 03:02:23 -0500, Daniel70 <daniel47@eternal-september.org> wrote:
On 27/01/2025 3:47 am, David W. Hodgins wrote:<snip>
The following script will show just usb drives ...
$ cat /home/dave/bin/listusbdrives
#!/bin/bash
-a-a-a-a for block in $(tree -if /sys/devices|grep usb|grep
/block/sd[a-z]$); do
-a-a-a-a-a-a-a-a device=${block##*/} # strip last slash and everything before
it.
-a-a-a-a-a-a-a-a printf '%s\n' "$device"
-a-a-a-a done
I'm guessing I'd have to adjust the /home/ *dave* /bin bit first!! ;-P
Yeah. What the above is showing is a script I wrote on my computer.
You'll need to create
the file in your ~/bin directory, copy/paste the script and save it,
then run
"chmod a+x ~/bin/listusbdrives" to make it executable.
Regards, Dave Hodgins
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 76 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 53:51:07 |
| Calls: | 1,265 |
| Calls today: | 1 |
| Files: | 1,362 |
| D/L today: |
3 files (2,684K bytes) |
| Messages: | 285,448 |