wEEK 14

Processes and Logs

This week explores how Linux keeps track of what is happening right now (processes) and how it records what has already happened (logs). These two parts of the system work together: processes do the work, and logs explain the story afterward. Understanding both helps you diagnose problems, confirm activity, and manage long-running tasks.

P-L-O-G (Processes→ Logs → Observe→ Group & Summarizes)

P - Processes

 

Processes represent running programs, whether they’re user commands, system services, or background tasks you started earlier. Managing them involves identifying what’s active, placing work in the background, and stopping tasks when needed.

CommandUseExample Application
ps -efFull system process listSpot high-consumption tasks or runaway jobs
ps -u "$USER"Only your processesCheck that your script is still running
ps -o pid,stat,time,cmdDetailed viewInspect process state and CPU time
command &Run in backgroundStart long-running analysis or data processing
kill PIDStop a processClean up test jobs or stalled tasks
Processes are the active “moving parts” of the system—knowing how to check them is essential for debugging or managing your own jobs.

L - Logs

Logs record events as they happen. They allow you to reconstruct the past—what ran, what failed, what warned you, and at what time. System services and applications both depend on logs for reliability.

ConceptWhat it meansCommands that connect
Creating logsCapture a program’s output for later reviewcommand > file.log, command 2> error.log
Keeping logs separateDistinguish between normal messages and warnings/errorsstdoutapp.log, stderrapp.err
Browsing logs safelyView long log files without editing themless file.log
Rotating logsArchive older logs to keep files manageablecp app.log app-$(date +%H%M%S).log

Logs are the system’s memory. If something happened, the log tells you when and how.

O - Observe

Observation focuses on quick checks. Instead of opening large files or scrolling endlessly, you use lightweight tools that show only what matters right now.

ConceptWhat it meansCommands that connect
Checking the latest activityRead the last few lines instead of entire logstail -n 10 file.log
Tracking logs as they updateWatch new events appear livetail -f file.log
Searching for warnings or failuresImmediately locate trouble spotsgrep WARN file.log
Measuring activity volumesCount entries to check how busy logs have beenwc -l file.log

Observation techniques help you answer: Is everything working now? and What changed recently?

Navigate the tree​

G — Group & Summarize

Grouping pulls patterns out of logs so you can understand behavior over time. Instead of reading line by line, you aggregate messages to see structure—how often something happens, when peaks occur, or how different severities compare.

ConceptWhat it meansCommands that connect
Counting severitiesHow many INFO vs WARN messages?grep INFO, grep WARN, uniq -c
Grouping by timestampSee which minutes or hours had the most activitycut, sort, uniq -c
Reviewing recent archivesSummaries across multiple rotated logsls -1t, tail
Multi-file searchesExamine trends across the entire log setgrep -Hn pattern logs/*

Summaries reveal trends that aren’t obvious from raw logs—ideal for spotting bursts, errors, or changes across runs.

 

This concludes Lecture 14: Processes and Logs. Please return to Blackboard to access the Week 10 materials.

Scroll to Top