List the partition table for /dev/sdb with fdisk.
Do not start an interactive edit session or write changes.
Which command is appropriate?
fdisk -l DEVICE lists disk and partition information and exits, allowing layout inspection without an edit session.
Detailed explanation
fdisk /dev/sdbIncorrect. fdisk without -l starts an interactive session.
Incorrect. fdisk without -l starts an interactive session.
fdisk --wipe always /dev/sdbIncorrect. --wipe can erase signatures and is not a read-only inspection.
Incorrect. --wipe can erase signatures and is not a read-only inspection.
fdisk -l /dev/sdbCorrect. fdisk -l /dev/sdb lists the partition table.
Correct. fdisk -l /dev/sdb lists the partition table.
fdisk --delete /dev/sdbIncorrect. A delete operation changes the layout.
Incorrect. A delete operation changes the layout.
Try it yourself
An example you can run in a temporary verification environment.
fdisk --help | sed -n '1,18p'Expected result
-lまたは--listがパーティションテーブル一覧である旨Key points
- -l means list
- The device limits scope
- No interactive editor is started
Notes
- Environment: util-linux fdisk 2.x / ヘルプ表示のみ
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.