Linux Flashcards

1
Q

What is a linux kernel?

A
  • The Linux Kernel is a low-level systems software whose main role is to manage hardware resources for the user.
  • ‘Kernell’ basically refers to that core component of the computer operating system that provides basic services for the other parts as well as interacts with user commands.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Why use linux?

A

It is an open-source operating system where programmers get the advantage of designing their own custom OS
Software and the server licensing required to install Linux is completely free and can be installed on many computers as required
It has low or minimum but controllable issues with viruses, malware, etc
It is highly secured and supports multiple file systems

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

What is the LILO Boot loader

A

Linux Loader

- boot loader for the Linux operating system to load it into the main memory so that it can begin its operations.

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

How to check memory on Linux

A

1 - /proc/meminfo
2 - ‘free -m’
3 - vmstat
4 - top

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

Maximum file name length

A

255

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

How do you redirect stderr in linux?

A

2>&1

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

What is a typical size for a swap partition under a Linux system?

A

The preferred size for a swap partition is twice the amount of physical memory available on the system. If this is not possible, then the minimum size should be the same as the amount of memory installed.

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

What are daemons?

A

Daemons are services that provide several functions that may not be available under the base operating system. Its main task is to listen for service request and at the same time to act on these requests. After the service is done, it is then disconnected and waits for further requests.

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

How do you stop and start system services in linux

A

systemctl start
systemctl stop
systemctl restart
systemctl status

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

How do you automatically start a linux service on boot?

A

systemctl enable

systemctl disable

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

How do you check how long a process took to start in linux

A

systemd-analyze blame

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

What command tells you inode space

A

df -i

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

What are the process states in Linux

A
New/Ready
Running
Blocked/Waiting
Terminated/Completed
Zombie
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Explain process management system Calls in Linux

A
  • fork(): used to create a new process
  • exec(): Execute new process.
  • wait(): wait until process execution.
  • exit(): exit from the process.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is network bonding

A

Network Bonding is a process of combining two or more network interfaces to form a single network interface.

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

How do you check sockets listening in linux

A

netstat -l (–listen)

17
Q

How do you change run level in linux

A

init #

18
Q

What are some default network ports

A

20 - FTP
22 - SSH
23 - Telnet
80 - HTTP

19
Q

What command will show which files opened by which process

A

lsof

20
Q

What is a zombie process?

A

A zombie process is a process whose execution is completed but it still has an entry in the process table

21
Q

How do you manage a firewall in linux

A

iptables

22
Q

How do you limit memory usage in linux

A

ulimit

23
Q

List common signals in Linux

A
1 - SIGHUP (Hangup)
3 - SIGINT (ctrl-c)
9 - SIGKILL - coredump
15 - SIGTERM
17 - SIGCHILD (Child process stopped)
20 - SIGSTOP (ctrl-z)
24
Q

How do you change the priority of a process in linux

A

nice
renice
20 is highest priority
-20 is lowest priority

25
Q

What is an inode?

A

An inode is a data structure in Unix that contains metadata about a file. Some of the items contained in an inode are:

1) mode
2) owner (UID, GID)
3) size
4) atime, ctime, mtime
5) acl’s
6) blocks list of where the data is

26
Q

What is LVM?

A

Logical Volume Manager

  • Way of grouping disks in to logical units
  • No RAID
  • lvcreate, lvextend
27
Q

What is ‘md’ ?

A

MD is Linux software RAID. RAID can be done either in hardware wherein there is a RAID controller that does RAID and presents a logical volume to the OS, or RAID can be done in software wherein the kernel has a RAID driver which takes one or more disks can does RAID across them. ‘MD’ refers to the software RAID component of Linux.

28
Q

What is a cookie?

A

Http cookie is a small piece of data that a server sends to a browser, which a browser usually stores in it’s cookie cache. Cookie can be used to maintain session information since HTTP is stateless, and also for user preferences at a given site. Cookies can also be used to store encrypted password.

29
Q

Define Linux Boot process

A
  • BIOS loads and performs POST (Power On Self Test)
  • MBR looked at to execute bootloader (Grub)
  • Load kernel choice
  • Mount filesystems
  • Start init (/etc/inittab)
  • Default run level of 3
30
Q

How do you update/upgrade packages in linux

A

Ubuntu
sudo apt-get update -y
sudo apt-get upgrade -y
apt-get install

Fedora
sudo yum update -y
sudo yum upgrade
yum install package

31
Q

What is a sticky bit?

A

A Sticky bit is a permission bit that is set on a file or a directory that lets only the owner of the file/directory or the root user to delete or rename the file.

32
Q

Force fsck on reboot

A

Create a file called /forcefsck

33
Q

what is SSH port forwarding

A

SSH port forwarding is a mechanism in SSH for tunneling application ports from the client machine to the server machine, or vice versa

34
Q

“filesystem is full” error, but ‘df’ shows there is free space.

A

Could be out of inodes

35
Q

what are common linux file types?

A
- is regular file
d is directory
l is link
p is pipe
b is block device
36
Q

What is a vLAN

A

Virtual LANs are logical grouping of devices in the same domain.

37
Q

How do you sniff network traffic on linux?

A

Use tcpdump –interface=”interface” -n

38
Q

What is LTS in Docker images?

A

Long Term Support