chrt command
Sets scheduler policy and priority for a running process or new command
Typical usage: system administrationIntroduction into chrt
The chrt
command can be used to change the policy and priority for the Linux scheduler that is applied to a running process or set it when running a new command. The command can also be used to display the current policy and priority.
Installation
When chrt is not installed by default, it can be added to the system using the relevant software package.
Package information for chrt
Operating system | Package name | Installation |
---|---|---|
AlmaLinux | util-linux-core |
|
Arch Linux | util-linux |
|
Debian | util-linux |
|
Fedora | util-linux-core |
|
Red Hat Enterprise Linux | util-linux-core |
|
Rocky Linux | util-linux-core |
|
openSUSE | util-linux |
|
Ubuntu | util-linux |
|
Your Linux distribution using a different package? Share your feedback.
Usage
Available options
Long option | Short option | Description |
---|---|---|
--batch | -b | Use SCHED_BATCH policy, scheduling for batch processes |
--fifo | -f | Use SCHED_FIFO policy (first in, first out) |
--idle | -i | Use SCHED_IDLE policy, for very low priority jobs |
--other | -o | Use SCHED_NORMAL (SCHED_OTHER) policy, default time-sharing for Linux |
--rr | -r | Use SCHED_RR, round-robin scheduling |
Missing an option in this overview? Share your feedback.
Examples using chrt
Show the assigned policy and priority for process ID 1234
chrt --pid 1234
Runs a command with a fairly low priority as a batch task (SCHED_BATCH)
chrt --batch 0 ls -l
Assign SCHED_OTHER policy with priority 0 for process ID 1234
chrt --other --pid 0 1234
Frequently Asked Questions
What is the chrt command and its purpose?
The chrt command is a command-line tool on Linux to set or change the scheduler policy and priority.
Which package provides the chrt command?
The command chrt is provided by the util-linux or util-linux-core package.
Related and similar commands
Linux has a lot of tools and commands available and sometimes you just need that little other tool. Here is a list of commands that are similar or related to chrt:
Command | Category | Summary |
---|---|---|
basename | files | Strips directory and file name suffix from a given path |
capsh | capabilities | Linux capabilities testing and debugging tool |
captest | capabilities | Capabilities and privilege escalation testing tool |
dmesg | logging | Shows kernel log messages |
filecap | capabilities | Display of Linux capabilities set on binaries in paths |
firejail | sandboxing | Sandboxing tool for Linux |
getcap | capabilities | Show file capabilities |
getpcaps | capabilities | Show process capabilities |
kill | processes | Sending signals to processes |
lsns | namespaces | Shows used namespaces |
lsusb | capabilities | Show USB devices |
netcap | capabilities | Display available capabilities for running processes using network sockets |
nice | processes | Runs commands with specified priority |
numactl | processes | Controls NUMA policy for processes and shared memory |
peekfd | processes | Tracks a process and show file descriptor activity |
pidof | processes | Returns process IDs for a process name |
pidstat | monitoring | Monitoring CPU, memory, and disk activity |
pidwait | processes | Wait for process to stop |
pmap | processes | Shows memory mapping of process |
prtstat | processes | Shows process details for selected process like state, CPU and memory usage |
pscap | capabilities | Display available capabilities for running processes |
pslog | logging | Shows which log files a process has opened |
pstree | processes | Show active processes and children like a tree |
pwdx | processes | Shows current working directory of a process |
renice | processes | Changes the priority of running processes |
setcap | capabilities | Add or remove Linux capabilities to a file |
slabtop | memory | Shows slab usage of kernel |
smem | memory | Show memory usage including swap |
strace | process inspection | Inspects running process |
uname | system information | Shows basic system information |
units | data conversion | Converts a unit into another one, like from Celcius to Fahrenheit |
watch | processes | Monitors changes in output of specified command |