In this age of graphical user interfaces, knowing your way around the command line can set you apart. It provides a powerful platform to interact with your system in a flexible, efficient, and comprehensive manner.
This SEO-optimized guide will walk you through the process of listing drives on your machine using Command Prompt and PowerShell on Windows 10 and 11, as well as on Linux. We will also cover network drives, mapped drives, drive letters, and partitions.
Command Prompt in Windows 10 and 11
Command Prompt is a command-line interpreter application available in most Windows operating systems. It’s used to execute entered commands.
To list all the drives using Command Prompt:
- Type
cmd
in the Windows search box and hitEnter
. - In the Command Prompt window, type
wmic logicaldisk get name
and pressEnter
.
The list of all drives, including hard disk partitions, removable devices, and network drives, will appear.
PowerShell in Windows 10 and 11
PowerShell is a more powerful tool built into Windows, providing more control over the system.
To list all drives in PowerShell:
- Open PowerShell by typing
PowerShell
into the Windows search box and pressingEnter
. - Type
Get-PSDrive -PSProvider 'FileSystem'
and pressEnter
.
This command will provide a list of all drives, along with additional information like used and free space.
Listing Drives in Linux
In Linux, the terminal is the equivalent of the command prompt in Windows.
To list all drives:
- Open the Terminal application.
- Type
sudo fdisk -l
and pressEnter
.
This command lists all drives and partitions, including their sizes and types.
Network Drives
In Windows, network drives can be listed using Command Prompt or PowerShell:
- Command Prompt: Use
net use
command to list all network-mapped drives. - PowerShell: Use
Get-PSDrive -PSProvider 'FileSystem'
as it lists all drives, including network drives.
Mapped Drives
Mapped drives are listed automatically with the commands described above. They can be identified by their paths, which point to network locations.
Drive Letters and Partitions
In Command Prompt or PowerShell, drive letters are displayed next to each listed drive. Drive letters, like C: or D:, represent different partitions or storage devices.
In Linux, drive partitions are displayed with the sudo fdisk -l
command. They’re usually labeled with the drive name followed by a number (e.g., sda1, sda2).
In conclusion
The command line provides an efficient way to list drives in your system, whether you’re using Windows or Linux.
Whether you need information about network drives, drive letters, or partitions, Command Prompt, PowerShell, and Linux Terminal have got you covered.
By mastering these commands, you’ll have another impressive skill in your tech-savvy toolkit.