Pocesses and task scheduling Flashcards
customize ps columns
ps -o comm,pid,ppid,user
show processes for a specific command
ps -C sshd
find pid of a specific process
pidof rsyslogd
pgrep rsyslogd
list processes by user or group
ps -u user1
ps -G root
explain niceness
the priority given to a process, -20 = highest priority, 19 = lowest priority, default is 0
list process with niceness column
ps -efl = lower case L
NI column is niceness
run a program with different niceness value
nice -n -10 top
or
nice -n 2 top
alter process priority will process running
sudo renice -n -5 $(pidof top)
list kill signals
kill -l
default kill signal number
15 - soft kill - terminate in an orderly fashion
kill crond with kill and pkill
sudo pkill crond
sudo kill $(pidof crond)
pkill uses the name as kill need PID
kill all crond processes
killall crond
force kill crond
kill -9 $(pidof crond)
pkill -9 crond
where are submitted at jobs stored
var/spool/at
submit an at job
at 11:30pm 3/31/22
at>date &> /tmp/date.out
at>press ctrl d