Linux Flashcards

1
Q

Explain the concept of a “process” in Linux

A
  • a process executes an instance of a program
  • It has its own memory space, program counter, registers, and system resources.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Describe the role of the Virtual File System (VFS) in Linux

A
  • The Virtual File System (VFS) is a layer of abstraction that provides a consistent interface for interacting with different file systems.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Discuss the Linux I/O model and the role of the I/O scheduler

A
  • The Linux I/O model revolves around asynchronous I/O operations.
  • The I/O scheduler manages the ordering of I/O requests
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Explain the Linux memory management system, including virtual memory, paging, and swapping

A
  • Linux memory management involves virtual memory, where each process has its own virtual address space.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the significance of system calls in Linux?

A
  • Provide a controlled entry point for user programs to access low-level kernel functionalities, ensuring security and stability.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Could you provide examples of common system calls and their role in interacting with the kernel?

A
  • fork(): Creates a new process.
  • open(): Opens a file and returns a file descriptor.
  • read(): Reads data from a file descriptor.
  • write(): Writes data to a file descriptor.
  • execve(): Executes a new program.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How does the kernel manage processes?

A
  • The kernel manages processes through the Process Control Block (PCB)
  • employs the scheduler to switch between processes, allowing multitasking and efficient resource utilization.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How does Virtual File System provide an abstraction layer for various file systems?

A
  • VFS abstracts away the underlying details of various file systems like ext4, NFS, and more, allowing applications to use common system calls for file operations.
  • VFS uses a set of function pointers to redirect these calls to the appropriate file system driver, ensuring seamless compatibility regardless of the actual file system in use.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

You have a Linux server with an unknown process listening on a network port. How do you work out which process is listening on the port?

A
  1. netstat -nlp will show processes listening on ports
  2. lsof -p PID will show all the files the process has open
  3. strace -p PID shows what system calls a process is making
  4. wireshark to show network traffic
How well did you know this?
1
Not at all
2
3
4
5
Perfectly