8000 GitHub - kgilmer/lsdisk: Print a list of attached disk drives
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

kgilmer/lsdisk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

$ lsdisk --help
Print a list of attached disks

Usage: 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:

$ ./target/release/lsdisk -bre
/dev/sda

build and run

$ cargo build
$ ./target/debug/lsdisk

About

Print a list of attached disk drives

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0