Linux MAKEDEV Command
MAKEDEV is a tool for creating device nodes in Linux systems. In Unix/Linux systems, device nodes exist as special files located under 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 is used as follows:
cd /dev
./MAKEDEV [选项] 设备名...
Examples of Common Device Names
tty- Terminal devicesttyS- Serial port deviceshd- IDE hard disk devicessd- SCSI/SATA hard disk devicesfd- Floppy disk deviceslp- Parallel port devicesmem- Memory devicesnull- Null devicezero- Zero devicerandom- Random number devices
Modern Alternatives
In modern Linux systems, MAKEDEV has been replaced by the following mechanisms:
- devtmpfs - Dynamic device nodes automatically created by the kernel
/devFilesystem - udev - Userspace device managers that dynamically manage device nodes
Notes
- Modern Linux distributions usually do not require manual use of MAKEDEV
- Operation
/devThe directory usually requires root privileges - Incorrectly created device nodes may cause system devices to malfunction
Example
Create the serial devices ttyS0 and ttyS1:
cd /dev
sudo ./MAKEDEV ttyS0 ttyS1
See which devices would be created without actually doing so:
cd /dev
sudo ./MAKEDEV ttyS0 ttyS1
On most modern systems, device nodes are created automatically, so manually using MAKEDEV is relatively rare.
Linux Command Reference