Everyday Guidebooks
Cover of The Linux Command Line for Incident Responders

Cybersecurity & IT

The Linux Command Line for Incident Responders

A Practical Guide to Processes, Logs, Network Connections, File Metadata, and Evidence Preservation

by Todd Michael

Available now

A suspicious process, an unexpected connection, or a changed file can send an incident responder looking for answers. Knowing which command to run is only the beginning: you also need to record what you did, understand how your actions affect the system, and avoid drawing conclusions the evidence cannot support.

The Linux Command Line for Incident Responders builds those habits through practical exercises with common tools. You'll inspect running processes and their relationships, examine logs and timestamps, review network connections, and collect file metadata. Along the way, you'll practice documenting commands and outputs, handling working copies, and explaining gaps in your observations.

Designed for aspiring analysts, system administrators, and certification candidates with basic Linux familiarity, this guide favors repeatable workflows over memorized command lists. Use its scenarios and checklists to build confidence in host triage—and to communicate clearly about what you found, what you changed, and what you still don't know.

Contents
  1. 1. The Responder's Command-Line Mindset
  2. 2. Build a Safe Practice Environment
  3. 3. Record Actions and Preserve Working Evidence
  4. 4. Orient Yourself on an Unfamiliar Host
  5. 5. Inspect Running Processes
  6. 6. Follow Process Context
  7. 7. Find and Read System Logs
  8. 8. Build a Cautious Event Timeline
  9. 9. Inspect Network Connections
  10. 10. Examine Network Configuration and Context
  11. 11. Inspect File Metadata
  12. 12. Collect and Compare Files Carefully
  13. 13. Work a Complete Host-Triage Scenario
  14. 14. Report Findings and Improve Your Workflow
  15. Other Books by Todd Michael

Read a sample: 1. The Responder's Command-Line Mindset

A Linux host rarely waits for an investigator to arrive. Processes start and exit, connections close, scheduled jobs run, and logs rotate. An administrator may be trying to restore service while a security team is trying to understand what happened. Every minute can change the material available for inspection.

That urgency makes the command line valuable. With a few familiar utilities, a responder can examine a host directly and capture observations without waiting for a specialized interface. It also makes the command line easy to misuse. A command that seems harmless may expose confidential information, alter access metadata, consume scarce resources, or produce output that is more limited than it appears.

This book treats host triage as a disciplined sequence of questions, observations, and decisions. You will learn commands for inspecting processes, logs, network connections, and files, but the central skill is not memorizing switches. It is knowing what you are authorized to do, why you are doing it, what the resulting output can support, and what it cannot.

Host triage is a focused examination intended to answer immediate questions and guide next steps. It may help an incident team decide whether a host needs isolation, whether an account requires investigation, or whether a more complete acquisition is warranted. Triage is not necessarily a complete reconstruction of an incident, and a clean-looking command output is not proof that a system is clean.

Before touching a host, translate the request into a small set of questions. For example:

- Is the reported service currently running, and under which account? - Are there network connections associated with the service at the time of inspection? - Do available logs show activity near the reported event? - Is there a file or process that needs closer examination or preservation?

Each question suggests a category of observation. It also suggests a limit. A current socket listing can help answer what the host reports as connected now; it cannot, by itself, tell you every connection that existed earlier. A process listing may show a command name and owner; it does not establish whether that process is legitimate.

A useful triage note separates three things:

1. Observation: What a command or other source actually showed. 2. Interpretation: What that observation might mean in context. 3. Next question: What would help distinguish competing explanations.

Suppose a process listing shows a program running from an unfamiliar directory. The observation is the reported process and its location. An interpretation might be that the program deserves investigation. The next question might be whether the file belongs to a known deployment. Calling it malicious before checking those possibilities would turn a lead into an unsupported conclusion.

The ability to log in to a system is not, by itself, a complete investigative mandate. Before beginning, identify who has authorized the work and what the authorization covers. The exact process will depend on the organization and the incident, but a responder should be able to answer practical questions such as:

- Which hosts, accounts, and time period are in scope? - Is the task limited to observation, or are collection and containment also authorized? - May sensitive files, process environments, or user communications be collected? - Where should captured data be stored, and who may access it? - Who makes operational decisions if a command could disrupt service? - What should happen if evidence points to a system outside the agreed scope?

Record the answers with the case or ticket reference and the identity of the person granting authorization. If a detail is unresolved, document the gap and seek clarification rather than quietly broadening the investigation. In a fast-moving incident, the team may need to proceed with a narrow, explicitly approved initial scope while other decisions are made.

Scope is not merely an administrative formality. It affects the technical plan. Authorization to inspect process names does not automatically answer whether you should capture full environment variables, which may contain credentials or other sensitive values. Permission to collect a suspicious file does not necessarily authorize copying an entire user directory. An instruction to “investigate the server” should not be interpreted as permission to terminate processes or delete files.

Containment deserves particular care. Disconnecting a host or stopping a service can reduce ongoing harm, but it can also interrupt business operations and destroy volatile context. The appropriate decision belongs within the incident response plan and the authority of the people responsible for it. A responder’s contribution is to explain the likely tradeoffs and record what was decided.

A plan does not have to be elaborate. For an initial response, it can be a short sequence:

1. Confirm the target, authorization, access method, and operational constraints. 2. Identify urgent decisions and the observations needed to support them. 3. Capture volatile information that is relevant and permitted. 4. Examine more persistent sources, such as available logs and selected files. 5. Preserve the selected output, document limitations, and hand off findings.

The sequence may change. If active harm is apparent and an authorized decision maker orders immediate isolation, containment can take precedence over observation. If the host is unstable, a time-consuming collection may be inappropriate. If a specialist is preparing an acquisition, your team may decide to limit interactive commands until that work begins.

The point is not to enforce one order in every case. It is to make the order deliberate. A good plan explains why a source…

More Cybersecurity & IT

Cover of The White Hat Bible, Volume 1The White Hat Bible, Volume 1Available nowCover of The White Hat Bible, Volume 2The White Hat Bible, Volume 2Available nowCover of The White Hat Bible, Volume 3The White Hat Bible, Volume 3Available nowCover of The White Hat Bible, Volume 4The White Hat Bible, Volume 4Available nowThe White Hat Bible, Volume 5Available nowCover of The White Hat Pocket GuideThe White Hat Pocket GuideAvailable now

About Todd Michael

Todd Michael is an American author and the founder of ToddMichael.tv. He writes practical, plain-English books on money, health, preparedness, technology, games, humor and more.

About the author Todd Michael · Todd Michael’s author site

Part of the ToddMichael.tv network.