Operations 4 min read

Practical Linux Commands for File Classification, Process Monitoring, and Network Analysis

This article demonstrates how to use xargs with find and tar for file handling, ps for identifying high‑memory and high‑CPU processes, and netstat combined with awk and sort to inspect TCP connection states and the top requesting IP addresses, providing essential command‑line techniques for system administrators.

DevOps Operations Practice
DevOps Operations Practice
DevOps Operations Practice
Practical Linux Commands for File Classification, Process Monitoring, and Network Analysis

The xargs command allows the output of one command to be used as arguments for another, simplifying many shell tasks.

Example 1 : Find all files ending with .conf under the root directory and classify them with the file utility: find / -name *.conf -type f -print | xargs file To archive those .conf files directly, combine find with tar via xargs:

find / -name *.conf -type f -print | xargs tar cjf test.tar.gz

2. List processes with high memory usage : Use ps piped to sort and head to show the top 20 memory‑consuming processes (the 4th column is the memory‑percentage): ps -aux | sort -rnk 4 | head -20 3. List processes with high CPU usage : Similar command, sorting by the 3rd column (CPU percentage): ps -aux | sort -rnk 3 | head -20 4. Check TCP connection states : Display the count of each TCP state, useful for analyzing port 80 connections: netstat -nat | awk '{print $6}' | sort | uniq -c | sort -rn 5. Identify the top 20 IP addresses generating the most requests , which can help detect potential attacks: netstat -anlp | grep 80 | grep tcp | awk '{print $5}' \ | awk -F: '{print $1}' | sort | uniq -c | sort -nr | head -n20 The article concludes with a reminder to like, share, and follow the source for more technical content.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

ShellSystem Administrationpsnetstatxargs
DevOps Operations Practice
Written by

DevOps Operations Practice

We share professional insights on cloud-native, DevOps & operations, Kubernetes, observability & monitoring, and Linux systems.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.