Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
24 views32 pages

Redhat QB Ans

The document is a question bank for the RedHat Academy Course RH124, covering key concepts of Red Hat OS, Linux commands, file management, user management, and system administration tasks. It includes both 2-mark and 3-mark questions with detailed answers on topics such as open-source software, command-line interface, file permissions, and networking. The content is structured into units, each focusing on different aspects of Linux and Red Hat systems.

Uploaded by

190020107043ait
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views32 pages

Redhat QB Ans

The document is a question bank for the RedHat Academy Course RH124, covering key concepts of Red Hat OS, Linux commands, file management, user management, and system administration tasks. It includes both 2-mark and 3-mark questions with detailed answers on topics such as open-source software, command-line interface, file permissions, and networking. The content is structured into units, each focusing on different aspects of Linux and Red Hat systems.

Uploaded by

190020107043ait
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 32

RedHat Academy Course (Industry Allied) RH124

RH124 Questionbank

2-Marks Questions

Unit I
1. Define RedHat OS.

Red Hat OS (Red Hat Enterprise Linux - RHEL) is a commercial Linux distribution developed
by Red Hat. It is designed for enterprise environments, offering stability, security, and long-
term support.

2. What is open-source software? Give a key characteristic.

Open-source software (OSS) is software whose source code is freely available for
modification and distribution.
Key characteristic: Users can view, modify, and redistribute the code under an open-source
license (e.g., GPL).

3. Explain the role of the command-line interface (CLI) in Linux.

The CLI allows users to interact with the Linux OS by typing commands, providing precise
control over system operations, automation, and administration tasks.

4. Name two reasons why Linux skills are valuable for IT professionals.

• High demand in enterprise environments (servers, cloud, DevOps).

• Cost-effective & secure, widely used in web servers, cybersecurity, and embedded
systems.

5. What is a Linux distribution?

A Linux distribution (distro) is a customized version of Linux that includes the Linux kernel,
software packages, and tools (e.g., RHEL, Ubuntu, Fedora).

6. Give an example of an industry where Linux is commonly used.

Cloud Computing (e.g., AWS, Google Cloud, and Azure rely heavily on Linux-based servers).
Unit II
7. What is the purpose of the passwd command?

The passwd command is used to change a user’s password. The root user can change any
user’s password, while regular users can only change their own.

Example:

bash

passwd username # (as root)

passwd # (regular user changes their own password)

8. Explain why Red Hat recommends logging in as a normal user instead of root.

• Security: Prevents accidental system-wide changes or deletions.

• Accountability: Actions are logged under a specific user, aiding in auditing.

• Least Privilege Principle: Reduces the risk of malware or unauthorized changes.

9. What is the difference between su and su -?

Command Behavior

Switches to the target user but keeps the current shell environment
su
(variables, working directory).

Switches to the target user and loads their login environment


su -
(home directory, shell settings).

Example:

bash

su username # Keeps old environment

su - username # Simulates a fresh login

10. Name two files that contain user and group information.
File Stores Access

/etc/passwd User accounts (UID, shell, home). Readable by all.

/etc/group Group memberships (GID, users). Readable by all.

/etc/shadow Encrypted passwords. Root-only.

• /etc/passwd – Stores user account details

- (UID, home dir, shell).

• /etc/group – Defines group memberships.

• /etc/shadow (Bonus) – Stores encrypted passwords.

11. What is the function of the useradd command?

The useradd command creates a new user account in Linux. It sets defaults (home directory,
shell) unless modified with options.

Example:

bash

useradd -m -s /bin/bash alice # Creates user "alice" with home dir and bash shell

12. List various Channels (File Descriptors) with their usage.

File Descriptor Channel Name Purpose

0 stdin (Standard Input) Accepts input (e.g., keyboard, pipe).

1 stdout (Standard Output) Displays normal command output.

2 stderr (Standard Error) Displays error messages.


Example: Redirecting stderr to a file:

bash

command 2> error.log

unit III
13. Name the three permission categories in Linux file systems.

The three permission categories in Linux are:

1. Owner (User) – Permissions for the file owner.

2. Group – Permissions for members of the file's group.

3. Others (World) – Permissions for all other users.

Example:

bash

-rw-r--r-- 1 user group 1024 Jan 1 10:00 file.txt # Owner (rw-), Group (r--), Others (r--)

14. What command is used to change file permissions?

The chmod (Change Mode) command is used to modify file permissions.

Example:

bash

chmod 755 script.sh # Sets rwxr-xr-x

chmod u+x file # Grants execute permission to the owner

15. What does PID stand for, and what is its purpose?

• PID = Process ID

• Purpose: A unique numerical identifier assigned to each running process, used to


manage (e.g., kill, monitor) processes.

Example:

bash

ps aux | grep nginx # Finds the PID of the Nginx process


16. Explain the purpose of the kill command.

The kill command terminates or sends signals to a process using its PID.

Example:

bash

kill -9 1234 # Forcefully kills process with PID 1234 (SIGKILL)

kill -15 1234 # Gracefully terminates (SIGTERM)

17. Define Process.

A process is an instance of a running program in Linux, managed by the kernel with a


unique PID. Processes consume system resources (CPU, memory).

Example:

• A web server (httpd), a bash shell, or a background service.

18. What is systemd?

systemd is a system and service manager in modern Linux distributions (including RHEL). It
replaces traditional SysV init, providing:

• Faster boot times.

• Dependency-based service management.

• Tools like systemctl to control services.

Example:

bash

systemctl start httpd # Starts the Apache service

systemctl enable httpd # Ensures it starts at boot


unit IV
19. Why is security important when configuring SSH?

SSH (Secure Shell) provides encrypted remote access to systems. Proper security is critical to
prevent:

• Unauthorized access (via weak passwords/key-based auth).

• Man-in-the-middle attacks (using strong encryption like AES).

• Brute-force attacks (by disabling root login & using fail2ban).

Example Secure Practices:

bash

Port 2222 # Change default port (22)

PermitRootLogin no # Disable root SSH login

PasswordAuthentication no # Enforce key-based auth

20. Give full form of TCP/IP and OSI.

• TCP/IP → Transmission Control Protocol / Internet Protocol

o Foundation of internet communication (e.g., HTTP, FTP).

• OSI → Open Systems Interconnection

o A 7-layer reference model for network communication

(Physical to Application).

21. What type of information can be found in system logs?

System logs (e.g., /var/log/messages, /var/log/secure) record:

• System events (boot errors, crashes).

• User logins (SSH, sudo attempts).

• Service logs (Apache, MySQL).

• Kernel messages (hardware failures).


Example:

bash

grep "Failed password" /var/log/secure # Check failed login attempts

22. Name a command used to configure network interfaces.

• nmcli (NetworkManager Command Line Interface)

bash

nmcli connection show # List connections

nmcli device status # Check interface status

• ifconfig (Deprecated but still used)

bash

ifconfig eth0 192.168.1.10 netmask 255.255.255.0

23. What is the purpose of a hostname?

A hostname identifies a machine on a network. It is used for:

• Network communication (e.g., SSH, web servers).

• System identification (in logs, prompts).

Example:

bash

hostnamectl set-hostname server1.example.com

24. What is the full form of SSH? And explain it.

• SSH → Secure Shell

• Purpose: A cryptographic network protocol for secure remote login, file transfer
(SCP/SFTP), and command execution over unsecured networks.

Key Features:

• Encrypts all traffic (prevents eavesdropping).

• Supports key-based authentication (more secure than passwords).


• Default port: 22 (can be changed for security).

Example:

bash

ssh [email protected] -p 2222 # Connect via custom port

unit V
25. What is the role of DNF in Red Hat Enterprise Linux?

DNF (Dandified YUM) is the package manager in RHEL used for:

• Installing, updating, and removing software packages.

• Resolving dependencies automatically.

• Querying package information (version, dependencies).

Example Commands:

bash

dnf install httpd # Install Apache

dnf update # Update all packages

dnf search nginx # Search for packages

26. Explain the purpose of a package repository.

A package repository is a centralized storage location (remote or local) that contains:

• RPM packages (software, libraries).

• Metadata (dependencies, versions).

Purpose:

• Provides a secure, standardized way to distribute software.

• Ensures dependency resolution (via DNF/YUM).


Example Repo:

bash

/etc/yum.repos.d/rhel.repo # Default RHEL repository config

27. List the naming pattern of Block Devices: SATA, SSDs.

Block devices (disks) follow Linux naming conventions:

• SATA HDD/SSD:

/dev/sdX (e.g., /dev/sda, /dev/sdb)

• NVMe SSD:

/dev/nvmeXnYpZ (e.g., /dev/nvme0n1p1)

• Virtual Disks (KVM):

/dev/vdX (e.g., /dev/vda)

Example:

bash

lsblk # List all block devices

28. What is a mount point?

A mount point is a directory where a filesystem (disk, partition, or network storage) is


attached to the Linux directory tree.

Example:

bash

mount /dev/sdb1 /mnt/data # Mounts partition to `/mnt/data`

df -h # Shows mounted filesystems

29. Name two commands used to locate files.

1. find – Searches for files by name, size, or type.

bash

find /home -name "*.txt" # Finds all .txt files in /home


2. locate – Uses a pre-built database for faster searches.

bash

locate httpd.conf # Finds paths containing "httpd.conf"

updatedb # Updates the locate database

30. What is the Red Hat Customer Portal used for?

The Red Hat Customer Portal is a support platform for RHEL users, offering:

• Knowledge Base (KB) articles (troubleshooting guides).

• Software downloads (ISOs, RPMs).

• Bug tracking & security advisories (RHSA).

• License management & support cases.


3-Marks Questions – Detailed Answers

1. How to view the contents of a file and count lines, words, and characters in RHEL?

Commands & Examples:

• View file contents:

bash

cat filename.txt # Displays entire file

less filename.txt # Scrollable view (press 'q' to exit)

head -n 5 filename.txt # Shows first 5 lines

tail -n 5 filename.txt # Shows last 5 lines

• Count lines, words, characters:

bash

wc filename.txt # Output: lines words characters filename

Example Output:

10 50 300 filename.txt # 10 lines, 50 words, 300 characters

2. What is Linux? Mention any two features of Linux.

• Linux is an open-source, Unix-like operating system kernel created by Linus Torvalds,


forming the core of distributions like RHEL, Ubuntu, etc.

• Two Key Features:

1. Multi-User & Multi-Tasking: Supports multiple users and processes


simultaneously.

2. Security: Built-in permissions (read/write/execute), SELinux, and firewall


(firewalld).

3. List and explain two file management commands in bash.

1. cp (Copy):
bash

cp source.txt /backup/ # Copies file to /backup/

cp -r dir1/ dir2/ # Recursively copies directories

2. mv (Move/Rename):

bash

mv oldname.txt newname.txt # Renames file

mv file.txt /tmp/ # Moves file to /tmp/

4. Steps to create a new user and assign them to a group in RHEL.

1. Create User:

bash

sudo useradd -m john # Creates user 'john' with home dir

sudo passwd john # Sets password

2. Assign to Group:

bash

sudo groupadd developers # Creates group (if not exists)

sudo usermod -aG developers john # Adds 'john' to 'developers'

3. Verify:

bash

id john # Shows user & group info

5. Two text editors in Linux + How to save a file.

1. Nano:

bash

nano file.txt # Opens file

o Save: Press Ctrl+O → Enter.

o Exit: Ctrl+X.

2. Vim:
bash

vim file.txt # Opens file

o Save & Exit: Press Esc → Type :wq → Enter.

6. System Admin Tasks – Commands

Task:

1. Create backup directory:

bash

mkdir /home/admin/backup

2. Move .log files:

bash

mv /var/logs/*.log /home/admin/backup/

3. Copy report.txt:

bash

cp /home/admin/docs/report.txt /home/admin/backup/

4. Delete tempfiles:

bash

rm -r /home/admin/tempfiles # -r for recursive deletion

7. Vim Operating Modes (Diagram + Explanation)

Vim has 3 primary modes:

1. Command Mode (Default):

o Navigate text (h, j, k, l).

o Delete lines (dd), copy (yy), paste (p).

2. Insert Mode:

o Press i (insert) or a (append) to edit text.

3. Ex Mode (Last-Line Mode):

o Press : to save (:w), quit (:q), or force actions (:q!).


Diagram:

+-------------------+ i/a/o +-------------------+

| Command Mode | ----------------> | Insert Mode |

+-------------------+ <---------------- +-------------------+

| ://? Esc / Ctrl+[

+-------------------+

| Ex Mode | (e.g., :wq, :set number)

+-------------------+

Example Workflow:

1. Open file: vim file.txt (starts in Command Mode).

2. Press i → Edit text → Esc to return to Command Mode.

3. Type :wq to save and quit.

8. Classify the UID ranges used for different users.

In Linux, UID (User ID) ranges are categorized as follows:

UID Range User Type Description

0 Root Superuser (administrative privileges).

1–200 System Users Reserved for system services (e.g., apache, postfix).

201–999 Dynamic System Users Used for system services (non-login).

1000+ Regular Users Created manually for human users.

Example:

bash

id username # Check UID of a user


9. Demonstrate a Process Lifecycle in Detail.

A Linux process transitions through these states:

1. Created (New): Process is forked (created) but not yet running.

2. Ready (Runnable): Loaded into memory, waiting for CPU time.

3. Running (Active): Executing on CPU.

4. Blocked/Waiting (Sleeping): Waiting for I/O or resources.

5. Terminated (Zombie): Process completes but remains in process table until parent
acknowledges.

Diagram:

+--------+ +--------+ +---------+ +--------+ +-----------+

| Created | -> | Ready | -> | Running | -> | Blocked| -> | Terminated|

+--------+ +--------+ +---------+ +--------+ +-----------+

Commands:

bash

ps aux # View process states (S=Sleeping, R=Running, Z=Zombie)

top # Real-time process monitoring

10. Visual Representation of Octal File Permissions

Linux permissions are represented in octal notation (0–7):

Octal Binary Permission Symbolic

0 000 No permission ---

1 001 Execute --x

2 010 Write -w-

3 011 Write + Execute -wx


Octal Binary Permission Symbolic

4 100 Read r--

5 101 Read + Execute r-x

6 110 Read + Write rw-

7 111 All (RWX) rwx

Example:

bash

chmod 755 script.sh # Owner: RWX, Group/Others: R-X

11. Interpret Network Interface Names

Linux uses predictable naming for interfaces:

Interface Type Naming Pattern Example

Ethernet (Older) eth0, eth1 eth0

Ethernet (New) enp3s0, ens33 enp0s3

Wireless wlp4s0 wlan0

Virtual (Bridge) virbr0 virbr0-nic

Command:

bash

ip link show # List all interfaces

12. Three Networking Commands

1. ping: Check connectivity.


bash

ping google.com # Test network reachability

2. ip: Modern replacement for ifconfig.

bash

ip addr show # Display IP addresses

ip route # Show routing table

3. ss: Socket statistics (replaces netstat).

bash

ss -tuln # List open ports (-t=TCP, -u=UDP)

13. locate Command in Linux

Purpose: Quickly find files using a pre-built database (faster than find).

Syntax:

bash

locate [options] pattern

Example:

bash

updatedb # Update database (run as root)

locate httpd.conf # Find all paths containing "httpd.conf"

14. Three File Commands in RHEL

1. touch: Create empty file.

bash

touch newfile.txt

2. file: Determine file type.

bash

file /bin/bash # Output: "ELF 64-bit executable"

3. stat: Display file metadata.


bash

stat filename # Shows size, permissions, timestamps

15. Three Basic Linux File Permissions

Permission Symbol Effect

Read (r) 4 View file contents/list directory.

Write (w) 2 Modify file/delete directory items.

Execute (x) 1 Run scripts/enter directory.

Example:

bash

chmod +x script.sh # Grant execute permission

16. List Running Processes

Command:

ps aux

Output Fields:

• USER: Owner of the process.

• PID: Process ID.

• %CPU: CPU usage.

• COMMAND: Command launched.

17. SSH for Secure Remote Access

SSH (Secure Shell) encrypts remote logins.

Usage:

bash
ssh [email protected] -p 22 # Connect to remote host

Key Features:

• Encrypts all traffic.

• Uses key-based auth (~/.ssh/id_rsa.pub).

18. Network Configuration Commands

1. nmcli:

bash

nmcli connection show # List connections

2. nmtui: Text-based GUI for NetworkManager.

19. Three Basic Linux Commands

1. ls: List files.

bash

ls -l /home # Detailed listing

2. grep: Search text.

bash

grep "error" /var/log/messages

3. cat: Display file.

bash

cat /etc/os-release

20. Three Process States

1. Running (R): Actively using CPU.

2. Sleeping (S): Waiting for I/O.

3. Zombie (Z): Terminated but not reaped by parent.

21. nmcli Command in RHEL


Purpose: Configure networking via NetworkManager.

Example:

bash

nmcli connection add type ethernet ifname eth0 # Add new connection

nmcli connection up eth0 # Enable interface

5-Marks Questions – Detailed Answers

1. Design a Red Hat Enterprise Linux (RHEL) Ecosystem in Detail

Components of RHEL Ecosystem:

1. Kernel (Linux Kernel)

o Core of the OS, manages hardware, processes, and memory.

o Supports SELinux for enhanced security.

2. Package Management (DNF/YUM & RPM)

o DNF (Dandified YUM): Installs, updates, and removes software.

o RPM (Red Hat Package Manager): Low-level package handling.

3. Systemd (Service & Boot Manager)

o Controls startup processes (systemctl commands).

o Manages services (httpd, sshd).

4. Security Features

o SELinux (Security-Enhanced Linux): Mandatory access control.

o Firewalld: Dynamic firewall management.

5. Red Hat Subscription Management (RHSM)

o Provides access to official repositories, patches, and support.

6. Virtualization & Cloud Integration

o Supports KVM (Kernel-based Virtual Machine).


o Integrates with OpenShift (Kubernetes) for containerization.

Example Workflow:

bash

sudo dnf install httpd -y # Install Apache using DNF

sudo systemctl start httpd # Start service via systemd

2. Structure and Purpose of System Directories in RHEL

Directory Purpose

/ (Root) Base of the filesystem hierarchy.

/bin Essential user binaries (e.g., ls, cp).

/etc Configuration files (e.g., /etc/passwd, /etc/fstab).

/home User home directories.

/var Variable data (logs, databases, mail).

/tmp Temporary files (cleared on reboot).

/usr User programs and libraries (e.g., /usr/bin, /usr/lib).

/boot Bootloader files (e.g., vmlinuz, initramfs).

/dev Device files (e.g., /dev/sda, /dev/null).

/proc Virtual filesystem for process and kernel info.

/opt Optional third-party software.

Example:

bash
ls /etc/ssh/sshd_config # View SSH server config

3. Steps to Log into Linux & Execute Basic Shell Commands

Login Methods:

1. Local Login:

o Enter username & password in the terminal.

2. SSH (Remote Login):

bash

ssh [email protected]

Basic Commands:

Command Purpose Example

pwd Print working directory. pwd → /home/user

ls List files. ls -l /etc

cd Change directory. cd /var/log

mkdir Create directory. mkdir ~/projects

echo Print text. echo "Hello"

4. Managing Files in Linux (CLI Examples)

Operation Command Example

Create touch / mkdir touch file.txt / mkdir dir1

Copy cp cp file.txt ~/backup/


Operation Command Example

Move mv mv old.txt /tmp/new.txt (Rename/Relocate)

Delete rm rm -r old_dir/ (Recursive delete)

View cat / less cat /etc/os-release

5. Output Redirection Operators

Operator Function Example

> Overwrite file. ls > filelist.txt

>> Append to file. date >> log.txt

2> Redirect stderr. grep "error" log.txt 2> errors.log

&> Redirect stdout + stderr. command &> output.log

| Pipe output to another command. ps aux | grep httpd

6. Creating, Viewing, and Editing Text Files

Command-Line Tools:

• cat: Display file.

bash

cat notes.txt

• nano: Simple text editor.

bash

nano notes.txt # Ctrl+O to save, Ctrl+X to exit

• vim: Advanced editor (modes: Insert, Command, Ex).


bash

vim notes.txt # Press `i` to edit, `:wq` to save & quit

7. Creating & Managing Users/Groups in RHEL

Steps:

1. Create User:

bash

sudo useradd -m john

sudo passwd john

2. Create Group:

bash

sudo groupadd developers

3. Assign User to Group:

bash

sudo usermod -aG developers john

4. Password Policies:

o Edit /etc/login.defs (set PASS_MAX_DAYS 90).

o Use chage to enforce expiry:

bash

sudo chage -M 90 john

Verification:

bash

id john # Check group membership

grep john /etc/passwd # Verify user details

5-Marks Questions – Detailed Answers (Continued)

8. Gaining Superuser Access & Managing Users/Groups in RHEL

1. Gaining Superuser Access


• su (Switch User):

bash

su - # Login as root (requires root password)

• sudo (Superuser Do):

bash

sudo command # Run a command as root (configured in /etc/sudoers)

2. Managing Local User Accounts

• Create User:

bash

sudo useradd -m username # -m creates home directory

sudo passwd username # Set password

• Modify User:

bash

sudo usermod -aG groupname username # Add to group

• Delete User:

bash

sudo userdel -r username # -r removes home dir

3. Managing Local Group Accounts

• Create Group:

bash

sudo groupadd developers

• Add User to Group:

bash

sudo usermod -aG developers username

• Verify:

bash

id username # Check group membership


9. Process States (Diagram + Explanation)

Linux Process Lifecycle States:

1. New (Created): Process is forked but not yet running.

2. Ready (Runnable): Loaded in memory, waiting for CPU.

3. Running: Actively executing on CPU.

4. Waiting/Sleeping: Blocked for I/O or resources.

5. Terminated (Zombie): Process exits but remains in process table.

Diagram:

+--------+ +--------+ +---------+ +--------+ +-----------+

| New | → | Ready | → | Running | → | Blocked| → | Terminated|

+--------+ +--------+ +---------+ +--------+ +-----------+

Commands to Check States:

bash

ps aux | grep process # S=Sleeping, R=Running, Z=Zombie

top # Real-time process monitoring

10. Commands to Monitor & Manage Processes

Command Purpose Example

ps List processes. ps aux

top Interactive process viewer. top (Press q to quit)

htop Enhanced top (install via DNF). htop

kill Terminate a process. kill -9 PID (SIGKILL)

pkill Kill by process name. pkill httpd


11. TCP/IP vs. OSI Model

TCP/IP Model OSI Model

4 Layers: 7 Layers:

1. Network Access 1. Physical

2. Internet (IP) 2. Data Link

3. Transport (TCP) 3. Network

4. Application 4. Transport

5. Session

6. Presentation

7. Application

Key Difference:

• TCP/IP is practical (used in the Internet).

• OSI is theoretical (for standardization).

12. IPv4 Subnet Masking

Subnet Mask Notation:

• Example: 192.168.1.0/24 (CIDR)

o Network ID: 192.168.1.0

o Usable Hosts: 192.168.1.1 to 192.168.1.254

o Broadcast: 192.168.1.255

Calculating Subnets:

• Formula: 2^(32 - n) (where n = CIDR bits).


• Example: /24 = 255.255.255.0 → 256 total addresses (254 usable).

Command to Check IP:

bash

ip addr show # Displays IP and subnet mask

13. Red Hat Insights Architecture

Components:

1. Client (insights-client):

o Collects system data (RHEL only).

2. Red Hat Cloud:

o Analyzes data for security, performance, and compliance risks.

3. Dashboard:

o Provides actionable recommendations (via access.redhat.com).

Workflow:

bash

sudo dnf install insights-client # Install client

sudo insights-client --register # Register system

14. File Permissions (chmod & chown)

Permission Types:

Symbol Octal Meaning

r 4 Read

w 2 Write

x 1 Execute

Examples:
• chmod:

bash

chmod 755 script.sh # Owner: RWX, Group/Others: RX

chmod +x file # Add execute permission

• chown:

bash

chown user:group file # Change owner & group

15. Configuring & Securing SSH

Steps:

1. Install OpenSSH:

bash

sudo dnf install openssh-server

2. Edit Config (/etc/ssh/sshd_config):

ini

Port 2222 # Change default port

PermitRootLogin no # Disable root login

PasswordAuthentication no # Enforce key-based auth

3. Restart SSH:

bash

sudo systemctl restart sshd

Why SSH?

• Encrypted communication.

• Prevents eavesdropping.

16. Monitoring Processes (top, ps, kill)

Commands:

• top:
bash

top -u apache # Show processes by user

• ps:

bash

ps aux --sort=-%cpu # List by CPU usage

• kill:

bash

kill -15 PID # Graceful termination (SIGTERM)

17. Configuring Network Interfaces

Using nmcli:

bash

nmcli connection add type ethernet ifname eth0 # Add connection

nmcli connection up eth0 # Enable interface

Static IP Configuration:

bash

nmcli connection modify eth0 ipv4.addresses 192.168.1.10/24

nmcli connection modify eth0 ipv4.gateway 192.168.1.1

nmcli connection up eth0

18. Locating Files

Operation Command

By Name find / -name "*.log"

Real-Time Search locate filename (requires updatedb)

By Ownership find / -user john


Operation Command

By Size find / -size +10M

By Modification Time find / -mtime -7 (last 7 days)

19. Linux Process Lifecycle (Diagram)

States:

1. New → Ready → Running → Waiting → Terminated

o Diagram:

+--------+ +--------+ +---------+ +--------+ +-----------+

| New | → | Ready | → | Running | → | Blocked| → | Terminated|

+--------+ +--------+ +---------+ +--------+ +-----------+

20. Network Management Commands

Command Purpose

ip Replace ifconfig (modern).

ss Socket statistics (replace netstat).

ping Check connectivity.

nmcli Configure NetworkManager.

Example:

bash

ip addr show # List IP addresses

ss -tuln # Check open ports

You might also like