batch
Quick Reference
Command Name:
batch
Category:
process management
Platform:
linux
Basic Usage:
Common Use Cases
Syntax
batch [file]
Options
Option | Description |
---|---|
file | Read commands from the specified file instead of standard input |
Note: The batch command has very few options itself, but it uses the at daemon (atd) for job scheduling. To see information about scheduled batch jobs, use the atq command. To remove scheduled batch jobs, use the atrm command.
Examples
How to Use These Examples
The examples below show common ways to use the batch
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
Basic Examples:
# Schedule a command to run when system load permits batch echo "tar -czf /backup/archive.tar.gz /home/user/data" > /dev/null 2>&1 [Ctrl+D]
Advanced Examples:
# Combine with redirection to create a log file batch find / -name "*.mp3" > /tmp/music_files.txt 2>/tmp/music_find_errors.log [Ctrl+D]