linux-non-device-files

Queries the list of regular files (non-device files) in the Linux system's /dev directory. Because only device files should exist in /dev, the presence of regular files may indicate that unauthorized files have been created. Use this during security audits to verify the presence of such abnormal files.

Command properties

PropertyValue
Command typeDriver query
Required permissionAdministrator
License usageCounted
Parallel executionNot supported
Distributed executionRuns on Data Node (mapper)

Syntax

linux-non-device-files

Output fields

FieldTypeDescription
file_pathstringAbsolute path of the file
file_namestringFile name
file_typestringFile type. file or directory
permissionsstringFile permission string (e.g., rwxr-xr-x)
file_sizelongFile size (bytes)
file_ctimetimestampFile creation time
file_mtimetimestampLast modification time
file_atimetimestampLast access time
owner_readbooleanWhether the owner has read permission
owner_writebooleanWhether the owner has write permission
owner_executebooleanWhether the owner has execute permission
group_readbooleanWhether the group has read permission
group_writebooleanWhether the group has write permission
group_executebooleanWhether the group has execute permission
others_readbooleanWhether others have read permission
others_writebooleanWhether others have write permission
others_executebooleanWhether others have execute permission

Error codes

Parsing errors
Error codeMessageDescription
95040no-read-permissionExecuted without administrator privileges
Runtime errors

N/A

Description

The linux-non-device-files command runs find /dev -type f -print to search for regular files (-type f) in the /dev directory. For each file found, it collects metadata and assigns the file path, size, timestamps, and permission information to output fields.

On a healthy system, only device files, symbolic links, and directories should exist in the /dev directory. If a regular file is found, it may indicate that malicious files have been concealed, requiring further investigation.

Examples

  1. Query non-device files in the /dev directory

    linux-non-device-files
    

    Queries the list of regular (non-device) files in the /dev directory.

  2. Query sorted by file size

    linux-non-device-files
    | sort -file_size
    

    Queries non-device files sorted by file size in descending order.