🖥️mknod
➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the mknod command with important options and switches using examples.
2 minute read
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ███╗ ███╗██╗ ██╗███╗ ██╗ ██████╗ ██████╗
# ████╗ ████║██║ ██╔╝████╗ ██║██╔═══██╗██╔══██╗
# ██╔████╔██║█████╔╝ ██╔██╗ ██║██║ ██║██║ ██║
# ██║╚██╔╝██║██╔═██╗ ██║╚██╗██║██║ ██║██║ ██║
# ██║ ╚═╝ ██║██║ ██╗██║ ╚████║╚██████╔╝██████╔╝
# ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝ ╚═════╝
mknod /dev/random c 1 8
# make a device
mknod pipe p
# mknod device-name device-type major-number minor-number is the command used to create device files
# create /dev/null if accidentally deleted or for a chroot
mknod -m 0666 /dev/null c 1 3
# This is sample output - yours may be different.
# - name: Mknod /dev/null to Chroot
/bin/mknod -m 0666 /dev/null c 1 3
# - name: Mknod /dev/random to Chroot
/bin/mknod -m 0666 /dev/random c 1 8
# - name: Mknod /dev/urandom to Chroot
/bin/mknod -m 0666 /dev/urandom c 1 9
mknod -m 0666 /dev/null_test c 1 3
stat /dev/null_test
File: '/dev/null_test'
Size: 0 Blocks: 0 IO Block: 4096 character special file
Device: 6h/6d Inode: 603 Links: 1 Device type: 1,3
Access: (0666/crw-rw-rw-) Uid: (0/ root) Gid: ( 0/ root)
# dont forget restorecon for selinux after creating
restorecon /dev/null
#==============================##==============================#
# CMD MKNOD #
#==============================##==============================#
Cheatsheets are an excellent complement to other information sources like Linux man-pages, Linux help, or How-To’s and tutorials, as they provide compact and easily accessible information. While man-pages and detailed tutorials often contain comprehensive explanations and extensive guides, cheatsheets summarize the most important options forthe command mknod in a clear format. This allows users to quickly access the needed information for mknod without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for mknod are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.