Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kgilmer/lsdisk
Print a list of attached disk drives
https://github.com/kgilmer/lsdisk
Last synced: about 2 months ago
JSON representation
Print a list of attached disk drives
- Host: GitHub
- URL: https://github.com/kgilmer/lsdisk
- Owner: kgilmer
- License: mit
- Created: 2024-03-31T00:12:15.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-04-04T01:31:35.000Z (10 months ago)
- Last Synced: 2024-04-04T02:37:29.759Z (10 months ago)
- Language: Rust
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `lsdisk`
Print a list of attached disk drives. Designed as a simplifying replacement for `fdisk -l`.
# demo
`lsdisk` prints the device path, the size of the block device in bytes, the model, and `[fixed|removable]`, sorted by device name:
```console
$ lsdisk --help
Print a list of attached disksUsage: lsdisk [OPTIONS]
Options:
-n, --non-loop-only Return only non-loop devices
-r, --removable-only Return only removable devices
-e, --expect-one Return error if matching devices not one
-b, --brief Only print the device path
-h, --help Print help
-V, --version Print version
```To find the only removable storage device, or return error if 0 or more than one removable device present:
```console
$ ./target/release/lsdisk -bre
/dev/sda
```# build and run
```console
$ cargo build
$ ./target/debug/lsdisk
```