Technical - Linux/OS Flashcards

1
Q

Hard vs Soft/Sym Link (+how to create)

A

Hard Link:
Definition: Filesystem entry pointing directly to the inode of a file.
Deletion Behavior: No problem
Creation: ln <source></source> <target></target>

Soft/Symbolic Link:
Definition: File system entry that creates a new inode that references the path to the target file.
Deletion Behavior: Broken link
Creation: ln -s <source></source> <target></target>

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

File Descriptor (Explain stdout, stderr, and stdin)

A

Definition: An integer that uniquely identifies an open file in a process.

Standard Descriptors:
stdin (0): Standard input.
stdout (1): Standard output.
stdout (2): Standard error.

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

Process vs Thread

A

Process:
Definition: An independent program in execution, with its own memory space.
Resource Sharing: None, separate memory space and resources.

Thread:
Definition: A smaller unit of execution within a process.
Resource Sharing: Separate registers and stack, but shares memory space.

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

Linux Boot Process (BIOS > MBR > GRUB/LILO > Kernel > Init System)

A

BIOS: Initializes hardware, loads and executes bootloader from MBR (Master boot record).
GRUB/LILO: Bootloader(GRUB) loads and executes the Linux kernel and mounts initial RAM disk
Kernel: Initializes system hardware and mounts the root filesystem.
Init System: Starts user-space processes (e.g., systemd, SysVinit).

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

Full Disk Encryption LUKS (TPM Integration)**

A

LUKS: Linux Unified Key Setup; provides full disk encryption.
TPM: Trusted Platform Module; stores encryption keys securely.
Integration: LUKS can be used with TPM to protect encryption keys against tampering.

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

Secure Boot

A

Purpose: Ensures that only signed and authorized software is loaded during boot.
Mechanism: Checks digital signatures of bootloaders and kernels to prevent unauthorized modifications.

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

Inode (How to check inode number and inode usage)

A

Index Node:
Definition: Data structure containing metadata about a file (e.g., size, permissions), but not file name or contents.
Check: ls -i <file> shows the inode number. df -i shows inode usage.</file>

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

Zombie Process

A

Definition: A process that has completed execution but still has an entry in the process table.
Cause: Parent process has not yet read the exit status.
Check: ps aux | grep Z

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

Iptables vs UFW**

A

Definition: User-space utility for configuring Linux kernel firewall.
Usage: iptables -A INPUT -p tcp –dport 22 -j ACCEPT (Allow SSH)

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

DF vs DU

A

DF: Shows filesystem disk space usage.
Command: df -h
DU: Shows disk usage of files and directories.
Command: du -sh <directory></directory>

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

SELinux**

A

Definition: Security-Enhanced Linux; provides mandatory access controls.
Commands:
Check Status: sestatus
Manage Policies: semanage, setenforce

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

How to check disk space, memory, cpu, and io

A

Disk Space: df -h
Memory: free -h
CPU: top or htop
IO: iostat (requires sysstat package)

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

How to check open files (+why significant)

A

Command: lsof
Significance: Identifies files and sockets opened by processes, useful for troubleshooting and security.

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

How to check open ports on local system

A

netstat -tuln

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

How to scan external system for open ports (+flags)

A

nmap -p <port-range> <target></target></port-range>

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

Systemd (How to create, status, stop, start)

A

Create Service: Write a .service file in /etc/systemd/system/
Status: systemctl status <service>
Start: systemctl start <service>
Stop: systemctl stop <service></service></service></service>

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

How to trace a network path from source to target

A

traceroute <destination></destination>

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

How to lookup IP for DNS record and reverse

A

DNS Record: dig <domain> or nslookup <domain>
Reverse Lookup: dig -x <IP> or nslookup <IP></IP></IP></domain></domain>

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

Linux Filesystem Architecture

A

Standard Dirs:
/root - home dir for root user
/bin - essential user command binaries
/boot - static files of boot loader
/dev - rep hardware devices
/etc - system-wide config
/home - user home dirs
/lib - shared libraries and kernel modules
/media - mount point for removable media
/mnt - mount point for temp mounted fs
/sbin - system bins
/srv - data for system services
/opt - add-on optional application pkgs
/root - Home dir for root user
/tmp - temporary fs
/usr - user-related programs
/var - variable data files w/frequent change

Special FSs:
/proc - virtual fs providing process and kernel info
/sys - virtual fs providing info and control over kernels devices and modules
/dev/shm - Temp file storage for inter-process comms

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

Linux Kernel Architecture**

A

Monolithic Kernel: A single large kernel that includes the core functionalities and all device drivers.

System Call Interface: Provides the interface between user-space applications and kernel services.

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

How to configure basic LAN:

A

Use netplan or ip commands to configure interface, addresses, gateway, and nameservers.

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

How to check running processes (+how to kill)

A

Running Processes: ps aux or top
Kill Process: kill <PID> or kill -9 <PID> (force kill)</PID></PID>

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

/proc**

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

/sys**

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
/dev/shm**
26
Linux Namespaces
27
Linux Control Groups (cGroups)
28
AppArmour
29
RAM Disk
30
strace
31
Linux Families/Distros (3)
1. Debian: Ubuntu, Mint 2. Fedora: RHEL, CentOS 3. SUSE: SLES, OpenSUSE
32
Linux vs Unix
33
Initialization Systems (SystemD vs InitD vs SystemV)
34
LVM
35
whatis vs apropos
36
man vs info
37
grep vs egrep (grep “” <>)
38
How to count words or lines in a file
39
Redirection: 1. Redirect stdout to file 2. Redirect stderr to file 3. Redirect stdout/stderr to file 4. Redirect stdout to file AND print 5. Redirect stderr to file AND print 6. Redirect stdout/stderr to file AND print 7. Overwrite vs append for both ways 8. Which operators will create file
40
Permissions: 1. What are the symbolic characters for users, operations, and permissions? 2. What are the octal numbers for permissions
1. ugoa +_= rwx 2. x=1, w=2, r=4
41
umask (what, how to set)
42
Compression vs archive (w/tar + gz & bz2)
43
journalctl (unit, grep, boot logs, config)
44
nice/renice
45
chrt
46
pgrep/pkill
47
sysVinit, upstart, and systemd
48
Tuned
49
Fdisk vs gdisk vs parted
50
Swap (what is it and basic steps to setup RHEL vs Ubuntu)
51
Steps to format and mount block device persistently.
52
List block devices and check partitions
53
xfs vs ext4 vs vfat vs ntfs
54
Brace expansion (list, range)
55
Paramater expansion (default use, default assign, substring, replace)
56
autofs and nfs/smb
57
setgid, setuid, and sticky bit
58
stat
59
at vs chrony
60
Background jobs, shell job table, and SIGHUP: 1. command & 2. nohup command & 3. ctrl-z 4. jobs 5. bg % 6. fg % 7. disown %
61
useradd, usermod, userdel, groupadd, groupmod, groupdel, passwd, chage
62
How to enforce password policies in Linux?
63
How to view and update firewall config: 1. ufw 2. firewalld/firewall-cmd
64
ACL: 1. setfacl 2. getfacl