File and Data Manipulation

Commands for handling data during security tasks.

• grep

• Purpose: Searches text for patterns.

• Example: grep "root" /etc/passwd → Finds lines with “root”.

• awk

• Purpose: Extracts and processes text fields.

• Example: awk -F: '{print $1}' /etc/passwd → Lists usernames.

• sed

• Purpose: Edits text streams.

• Example: sed 's/old/new/g' file.txt → Replaces “old” with “new” in file.txt.

• curl

• Purpose: Fetches data from URLs.

• Example: curl http://example.com → Downloads webpage content.

• wget

• Purpose: Downloads files from the web.

• Example: wget http://example.com/file.zip → Saves file.zip.