Linux Commands

fdisk -l Command in Linux

The fdisk is a Linux command called fixed disk/format disk and is used with the Linux/Unix-based systems for command-line-based disk manipulation process. The fdisk command is commonly used to create partitions, view, delete, resize, copy, change, and move to a hard disk with its user-friendly interface.

It is used to create and organize space for new partitions or new drives, rearrange old drives, and move and copy information to new disks. In your system, you can create as many partitions as you want, and you can extend the partitions using fdisk commands. Remember, you must be the root user to run the fdisk command. This guide will show you the use of fdisk -l commands in Linux.

How To Use fdisk -l Command in Linux

First, let’s execute the basic command used to list all existing disk partitions on the system:

sudo fdisk -l

The –l argument specifies listing all the partitions used with the fdisk command, and their devices’ names display the partitions.

View a Specific Disk Partition

You can execute the following command to view all partitions of a specific hard disk:

fdisk -l /dev/sda

The previous command included the –l argument followed by the specific device name like “/dev/sda”.

fdisk Command Help

You can use the following commands to get the information about the option available in fdisk:

fdisk --help

If you want to know more about the fdisk command and how you create partitions, we recommend you visit this page. We have uploaded a brief guide to help you make the partition using the fdisk command in Linux.

Conclusion

In this guide, we have explained the different uses of the fdisk partition commands in Linux. It may seem a little complicated to understand the commands initially, but you will become excellent at using them once you get hands-on practice. We hope this guide is simple to understand the fdisk commands in Linux. Feel free to ask if you have any queries in the comment section.

About the author

Prateek Jangid

A passionate Linux user for personal and professional reasons, always exploring what is new in the world of Linux and sharing with my readers.