Pocesses and task scheduling Flashcards

1
Q

customize ps columns

A

ps -o comm,pid,ppid,user

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

show processes for a specific command

A

ps -C sshd

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

find pid of a specific process

A

pidof rsyslogd
pgrep rsyslogd

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

list processes by user or group

A

ps -u user1
ps -G root

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

explain niceness

A

the priority given to a process, -20 = highest priority, 19 = lowest priority, default is 0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

list process with niceness column

A

ps -efl = lower case L
NI column is niceness

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

run a program with different niceness value

A

nice -n -10 top
or
nice -n 2 top

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

alter process priority will process running

A

sudo renice -n -5 $(pidof top)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

list kill signals

A

kill -l

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

default kill signal number

A

15 - soft kill - terminate in an orderly fashion

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

kill crond with kill and pkill

A

sudo pkill crond
sudo kill $(pidof crond)

pkill uses the name as kill need PID

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

kill all crond processes

A

killall crond

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

force kill crond

A

kill -9 $(pidof crond)
pkill -9 crond

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

where are submitted at jobs stored

A

var/spool/at

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

submit an at job

A

at 11:30pm 3/31/22
at>date &> /tmp/date.out
at>press ctrl d

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

list at jobs

A

atq

17
Q

where are system crontables stored

A

/etc/crontab
/etc/cron.d

18
Q

where are submitted cron jobs stored for user1

A

/var/spool/cron/user1

19
Q

crontable syntax

A

Field1 - minute of hour
Field2 - hour of day
Field3 - Day of month
Field4 - Month of year
Field5 - day of week
Field6 - Command or program to execute

*/5 10-11 5,20 * * echo “Hello” > /tmp/hello.out

https://www.adminschoice.com/crontab-quick-reference
https://crontab.guru/

20
Q

Where do the scheduling daemons store log information of executed jobs?

A

The scheduling daemons store log information of executed jobs in the
/var/log/cron file.