SAM-PREFINAL
Process Characteristics
Initiated from GUI or command line.
Can spawn new processes.
Created only by other processes.
Commands for Viewing and Controlling Processes
ps: Displays a snapshot of current processes.
top: Shows current active tasks.
jobs: Lists active jobs.
bg: Sends a job to the background.
fg: Brings a job to the foreground.
Process States in ps Command
State | Meaning |
|---|---|
R | Running |
S | Sleeping (awaiting an event) |
D | Uninterruptible sleep (awaiting I/O) |
T | Traced or stopped |
Z | Zombie (terminated but not cleaned up) |
Additional Indicators with Process States
<: High priority.N: Low priority.L: Locked in memory (real-time I/O).s: Session leader.l: Multi-threaded.+: In foreground group.
ps Command with aux Option Headers
Header | Meaning |
|---|---|
USER | Owner of the process |
%CPU | CPU usage percentage |
%MEM | Memory usage percentage |
VSZ | Virtual memory size |
RSS | Resident set size (physical memory used) |
START | Process start time |
top Program Overview
System Summary: Shows time up and load average (last 1, 5, and 15 minutes).
Tasks Summary: Number of processes and states.
CPU Activities: Includes user, system, and idle %.
Columns in top Program
Header | Meaning |
|---|---|
PID | Process ID |
USER | Username |
PR | Priority (ranges from -20 to 19) |
NI | Niceness value |
VIRT | Total virtual memory used |
RES | Resident size in KB |
SHR | Shared memory size |
S | Process status |
%CPU | CPU usage at last update |
%MEM | Memory usage at last update |
TIME+ | Cumulative CPU time used |
COMMAND | Name or path of process |
Controlling Processes
Interrupt a process:
Ctrl + C.Background a process: Use
bgorjobs.Return a process to foreground: Use
fg.
Networking Basics
Computer Network: A system connecting computers to share resources.
Requires:
Network interface (e.g., Ethernet device).
Running network services.
Access to a network broadcast device (hub, switch, router, gateway).
TCP/IP Layers
Network Interface Layer: Handles packet placement and reception.
Internet Layer: Addresses, packages, and routes packets (includes IP, ARP, ICMP, IGMP).
Transport Layer: Provides communication services (includes TCP, UDP).
Application Layer: Deals with data exchange protocols (e.g., HTTP, FTP, SMTP, Telnet).
Networking Protocols
DNS: Resolves hostnames to IP addresses.
RIP: Exchanges routing info between routers.
SNMP: Manages network devices.
Common Networking Commands
ping: Sends ICMP ECHO_REQUEST to hosts.traceroute/tracepath: Traces packet routes to hosts.ip: Manages routing and devices.netstat: Displays network connections and statistics.ftp: File transfer program.wget: Downloads files non-interactively.ssh: Remote login program (OpenSSH).