/dev/null

From Chaz Wiki
Revision as of 17:12, 18 April 2025 by Blotre (talk | contribs)
Jump to navigation Jump to search

/dev/null is a Linux null device file. It (in simplification,) is a kind of hack to throw files to go down a server [1]. Let’s take a look at understanding what it means, and what we can do with this file.

Properties

This will return an End of File (EOF) character if you try to read it using the cat command.

cat /dev/null

This is a valid file:

stat /dev/null

This gives me an output of...

File:/dev/null Size:0 Blocks:0 IO Block:4096 character special file Device:6h/6d Inode:5 Links:1 Device type:1,3 Access:(0666/crw-rw-rw-) Uid:( 0/ root) Gid:( 0/ root) Access:2020-02-04 13:00:43.112464814 +0530 Modify:2020-02-04 13:00:43.112464814 +0530 Change:2020-02-04 13:00:43.112464814 +0530