Linux Maintenance Flashcards

1
Q

Search system for root SUID bit set

A

find / -user root -perm 4000
Or -perm -u+s

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

How to view all processes Inc background

A

ps aux

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

Which command lets you view process by most resources used with updates every 3 seconds

A

top

NB press ‘H’ while running for interactive commands

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

3 ways to change priority of process

A

nice -n <-20..19> PSPATH

renice <-20..19> PSID

Press ‘R’ while running ‘top’

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

What is the absolute kill signal

A

kill -9 PID

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

What is the kill hang up signal

A

kill -1 PID

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

What is the kill interrupt signal

A

kill -2 PID

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

What is the kill termination (and default) signal

A

kill -15 PID

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

What is the kill with core dump signal saved to working directory and called core)

A

kill -3 PID

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

How to start a task/process and have it run in the background

A

PS/CMD &

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

How do you bring a process back to the foreground

A

fg PSID

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

How do you schedule a process

A

at <7.20pm> <08/08/1888>
at NOW + <5 minutes/hours>

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

How do you view default environment variables

A

env

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

How do you view ALL variables (env,shell,usr,aliases)

A

set (| more)

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

How do you make a variable change permanent

A

export VARIABLE

(after changing the VARIABLE)

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

How do you view your PATH

A

echo $PATH

17
Q

How do you view the content of a variable

A

Use a $
Eg echo $VARIABLE

18
Q

How do you add to the PATH

A

PATH=$PATH:/DIR

19
Q

How do you archive a group of similar files

A

tar -cvf OUTPUT.tar FILE FILE

20
Q

How do you view contents of a .tar

A

tar -tvf FILE

21
Q

How do you extract a .tar

A

tar -xvf FILE

22
Q

How do you use gzip

A

gzip FILE.*

Creates a .gz extension

gunzip FILE.*

23
Q

How do you use ‘compress’

A

compress FILE.*

Creates a .Z extension

uncompress FILE.*

24
Q

How do you make an exact copy of a file/dir

A

dd if=<file/dir> of=<file/dir >

25
Q

What are two common options for dd

A

bs=BLOCK IN BYTES

conv=noerror

26
Q

How do you produce a list of ‘block’ devices

A

lsblk

27
Q

How do you view a full list of (drive) devices?

A

sudo fdisk -l

28
Q

How would you mount a second hard drive

A

mount /dev/sdb1 /mnt

29
Q

How would you mount a flash drive

A

mount /dev/sdc1 /media

30
Q

Where are files systems that are mounted at boot time stored?

A

/etc/fstab

(Short for filesystem table)

31
Q

How would you unmount a hard drive

A

umount /dev/sdb1

32
Q

What command to view basic information and free space on mounted discs/devices

A

df /PATH

Or no path needed to view all

33
Q

How would you check for errors in the filesystem?

A

fsck

unmount first
-p automatically repairs

34
Q

How do you see all the WAPs in range?

A

iwlist INTERFACE scan

eg iwlist wlan0 scan

35
Q

How would you connect to an WAP

A

nmcli device wifi connect SSID password PASSWORD

36
Q

What command do you use to ‘tune’ kernel options

A

sysctl

37
Q

How do you make sysctl changes (carefully) permanent

A

Edit /etc/sysctl.conf

38
Q

How do you find out more information about your OS

A

uname -a

39
Q

ps options

A

-a of all users
-e all processes running on sys
-t all processes run by terminal
-u username and start time
-x run by current user