/tmp
The shared directory where any user or program can create temporary files, often cleared on reboot.
In more detail
Because every user can write there, /tmp has the sticky bit set: you can create files but cannot delete or rename other users' files. Its mode is 1777, the leading 1 being the sticky bit. Do not keep anything there you need after a reboot.
Examples
Because anyone can write there, attackers drop tools in /tmp or /var/tmp, often with hidden names starting with a dot.In this course: Test tools put their scratch directories under the system temporary directory, which is /tmp on most Linux systems and a per-user folder on macOS. Never rely on a fixed name there in a test; ask for a private directory instead.Related terms
- sticky bit — A special permission on a directory that lets users delete or rename only their own files inside it, even when everyone may write there.
- Filesystem Hierarchy Standard — The convention that says what each top-level Linux directory, such as /etc, /var and /home, is for.
- world writable — A permission setting that lets every user on the system modify a file or add and remove entries in a directory.
- /var/log — The directory on Linux where system services write their log files.
- auditd — The Linux audit daemon, which records kernel events such as system calls and file changes according to audit rules.
- tmp_path — A built-in pytest fixture that gives each test its own fresh temporary directory as a pathlib.Path.
- filesystem — The way an operating system organises files and folders on a disk or in memory.
Taught in
- EventBridge Rules: The Rule That Matched Nothing — AWS Certified DevOps Engineer – Professional (DOP-C02) Exam Prep
- Remediation As Code: A Public Bucket Appears — AWS Certified DevOps Engineer – Professional (DOP-C02) Exam Prep
- Artifacts: Files That Outlive The Pod — Certified Argo Project Associate (CAPA) Exam Prep
- Probes And Health Checks — Certified Kubernetes Application Developer (CKAD) Exam Prep
- SecurityContexts And Capabilities — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Immutable Containers: Read-Only At Runtime — Certified Kubernetes Security Specialist (CKS) Exam Prep
- The Filesystem Hierarchy — Linux Fundamentals & Systems Administration
- Directories, Umask And The Sticky Bit — Linux Fundamentals & Systems Administration
- Windows Event Logs, Sysmon & Linux Auditd Telemetry — Security Operations & Threat Hunting (SOC)
- Testing The Filesystem — Automated Testing, TDD & Quality Engineering
- The App In /bin That Vanished: The FHS, Distributions And Licences — CompTIA Linux+ (XK0-006) Exam Prep
- Down Until Morning: Unit Files, Drop-ins, Masks And systemd's Helpers — CompTIA Linux+ (XK0-006) Exam Prep
- The Cleanup That Emptied The Wrong Directory: Shell Scripts Under Exam Conditions — CompTIA Linux+ (XK0-006) Exam Prep
- The Virtual File System: /proc, /sys, Binds And tmpfs — Linux Foundation Certified System Administrator (LFCS) Exam Prep
- The File Hierarchy And Finding Files — LPIC-1 Linux Administrator (101-500 and 102-500) Exam Prep
References
Certification courses
- AWS DevOps Engineer Professional course and practice exam: DOP-C02
- CAPA course and practice exam: Certified Argo Project Associate
- CKAD course and practice exam: Certified Kubernetes Application Developer
- CKS course and practice exam: Certified Kubernetes Security Specialist
- CompTIA Linux+ course and practice exam: XK0-006
- LFCS course and practice exam: Linux Foundation Certified System Administrator
- LPIC-1 course and practice exam: Linux Administrator (101-500 and 102-500)