linux-tmp-files

Traverses the /tmp directory and its subdirectories on a Linux system to retrieve a list of all files. During forensic analysis, this command can be used to detect malicious files or attack traces left in the temporary directory.

Command properties

ItemDescription
Command typeDriver query
Required permissionAdministrator
License usageLicensed command
Parallel executionNot supported
Distributed executionRuns on Data Node (mapper)

Syntax

linux-tmp-files

Output fields

FieldTypeDescription
file_pathstringAbsolute path of the file
file_namestringFile name
file_typestringFile type. file: regular file, directory: directory
permissionsstringPOSIX file permission string (e.g., rwxr-xr-x). Returns null if unreadable.
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

Parse errors
Error codeMessageDescription
95040no-read-permissionOccurs when run without administrator privilege
Runtime errors

N/A

Description

The linux-tmp-files command recursively traverses the /tmp directory to collect metadata for all files. For each file, it assigns file path, size, timestamps, and POSIX file permission information to output fields.

The command follows symbolic links to read file attributes. If visiting a file fails (e.g., due to insufficient permissions), that file is skipped and the traversal continues.

This command requires administrator privilege. Without it, an error occurs at the parse stage.

Examples

  1. Retrieve a list of files in the temporary directory

    linux-tmp-files
    

    Retrieves a list of all files in the /tmp directory.

  2. Retrieve large temporary files

    linux-tmp-files
    | search file_type == "file"
    | sort -file_size
    | limit 20
    

    Filters only regular files in the /tmp directory, sorts them in descending order by size, and retrieves the top 20.

  3. Detect executable files in the temporary directory

    linux-tmp-files
    | search file_type == "file" and owner_execute == true
    

    Retrieves files with execute permission in the /tmp directory. The presence of executable files in a temporary directory can be an indicator of a security incident.