xargs vs while read: Which One and When
xargs and while read both loop over input, but they handle arguments, signals, and performance differently. Here's when to use each.
All the articles with the tag "cli".
xargs and while read both loop over input, but they handle arguments, signals, and performance differently. Here's when to use each.
ss replaces netstat on modern Linux: faster, shows more socket detail, and reads from the kernel. Every netstat command you rely on, rewritten for ss.
Practical find command examples: -mtime, -newer, -type, -exec vs xargs, -not, size filters. The patterns you google every time.
Use strace to trace system calls and debug mysterious permission errors, missing files, and network issues without ever reading source code.
Copy and paste from the Linux terminal without a mouse. Master xclip, xsel, wl-copy, and integrate clipboard with tmux and SSH.
lsof shows every open file, socket, and port on the box. Find what holds a port, trace deleted files still eating disk, and see what a service owns.
Schedule one-off Linux tasks with `at` instead of cron. Learn syntax, queue management, batch jobs, and when to use it for delayed reboots and reminders.
By default bash history is lost across multiple terminal sessions. Fix it with histappend and PROMPT_COMMAND so nothing gets overwritten.
echo is convenient but inconsistent across systems; printf is portable and precise, know when to use each and avoid the gotchas.
grep is more powerful than you think, regex patterns, context flags, recursive search, and piping tricks that save hours of log digging.
The Linux commands every sysadmin reaches for daily, file ops, process management, networking, and text manipulation you can't live without.
Move Docker images between hosts without a registry using docker save and docker load, air-gapped deployments made simple.