uname
The command that prints information about the running operating system kernel; uname -s prints just its name, such as Linux or Darwin.
In more detail
uname -s prints the kernel name, uname -r its release and uname -m the processor architecture. It is a quick way to check which kind of machine a command actually ran on.
Examples
ansible localhost -m ansible.builtin.command -a "uname -s" prints Darwin on a Mac.uname -srRelated terms
- kernel — The core of an operating system that controls the hardware and decides what every program is allowed to do.
- macOS — Apple's operating system for Mac computers, built on a Unix-like core called Darwin.
- command module — The module that runs any program you name on the host and reports what it printed, without being able to tell whether it changed anything.
- operating system — The base software, such as Linux, Windows or macOS, that runs a computer and lets other programs use it.
Taught in
- Your First Ad Hoc Command — Ansible Configuration Management at Scale
- Connections And Privilege Escalation — Ansible Configuration Management at Scale
- Scheduling, Monitoring And A Script That Reports — Bash Scripting & Command Line Automation
- Sandboxed Pods: RuntimeClass And gVisor — Certified Kubernetes Security Specialist (CKS) Exam Prep
- Four Minutes To Boot: Firmware, GRUB, Kernel And Targets — CompTIA Linux+ (XK0-006) Exam Prep