Linux MAKEDEV Command

Linux 命令大全Complete List of Linux Commands

AKEDEV is a tool used to create device nodes in Linux systems. In Unix/Linux systems, device nodes exist as special files located in the /dev directory, used to communicate with hardware devices or virtual devices provided by the kernel.

Syntax

MAKEDEV -V
MAKEDEV [ -n ] [ -v ] update
MAKEDEV [ -n ] [ -v ] [ -d ] device ...

Basic Usage

MAKEDEV is usually located in the /dev directory, and its usage is:

cd /dev
./MAKEDEV [选项] 设备名...

Common Device Name Examples

  • tty- Terminal devices
  • ttyS- Serial port devices
  • hd- IDE hard disk devices
  • sd- SCSI/SATA hard disk devices
  • fd- Floppy disk devices
  • lp- Parallel port devices
  • mem- Memory devices
  • null- Null devices
  • zero- Zero devices
  • random- Random number devices

Modern Alternatives

In modern Linux systems, MAKEDEV has been replaced by the following mechanisms:

  1. devtmpfs- The kernel-automatically-created dynamic/devfile system
  2. udev- User-space device manager, which dynamically manages device nodes

Notes

  • Modern Linux distributions generally do not require manual use of MAKEDEV.
  • Operating/devthe /dev directory usually requires root privileges.
  • Incorrect creation of device nodes can cause system devices to malfunction.

Examples

Create serial port devices ttyS0 and ttyS1:

cd /dev
sudo ./MAKEDEV ttyS0 ttyS1

View which devices will be created but don't actually execute:

cd /dev
sudo ./MAKEDEV ttyS0 ttyS1

In most modern systems, device nodes are automatically created, and manual use of MAKEDEV is relatively rare.

Linux 命令大全Complete List of Linux Commands

Other Extensions