Updated: 28 September 2026 · Applies to: AlmaLinux 9, Rocky Linux 9, Ubuntu 24.04 and Debian 12
Send a command's output to a file or to another command:
ls *.png > images.txt # write output to a file (overwrite) ls *.jpg >> images.txt # append to a file command 2> errors.txt # write errors to a file command > all.txt 2>&1 # output and errors to one file command > /dev/null 2>&1 # discard everything ls | grep backup # pipe output into another command command | tee out.txt # show output and save it
Ucartz services for this topic
- KVM VPS hosting: NVMe SSD and full root access, with Free Basic Managed Support.
- Unmanaged dedicated servers: full root access and free IPMI KVM, with Free Basic Managed Support.
- Linux server management: hardening, patching, monitoring and automation for Ubuntu, Debian, RHEL and AlmaLinux.
