At-a-Glance Reference

Linux Inspection Essentials

Read files, paths, permissions, and processes before making changes. Examples use a Linux shell.

Confirm Your Location

pwd
ls -la

Print the current directory before interpreting a relative path. The listing includes hidden names and permission information. Work in a dedicated practice folder containing disposable data; a correct command used in the wrong directory can still produce the wrong outcome.

Read a Manageable Part of a Log

head -n 10 sample.log
tail -n 10 sample.log

These commands read the first or last ten lines without editing the file. A short excerpt can help identify the format, but it does not represent the whole dataset. Record which portion you inspected when writing an investigation note.

Find an Exact Text Pattern with Line Numbers

grep -nF -- 'ERROR' sample.log

The fixed-string option avoids treating the pattern as a regular expression; line numbers help connect an observation to its source. Matching is case-sensitive here. A line containing ERROR is a search result, not proof of a security incident.

Find Practice Log Files

find . -type f -name '*.log'

Search starts at the current directory and returns regular files whose names match the pattern. Quotes keep the shell from expanding the wildcard before find receives it. This example only lists files; inspect the list before adding any operation that changes them.

Inspect Permissions and Processes

ls -ld . sample.log
ps -eo pid,ppid,comm

Directory permissions affect access through the directory, while file permissions affect the file itself. The process view shows identifiers, parent identifiers, and command names. Interpret a name together with other evidence; a familiar process name alone does not prove that its activity is benign.

HACKTRONIAN_CLI // COMMAND PALETTE
QUICK_EXEC: