Building a directory structure one mkdir at a time or hunting for PIDs with ps and grep wastes time on every server you manage. Here’s how mkdir -p, heredocs, tar -C, pkill, and pidwait can simplify these tasks with fewer commands.
Most of us learn a way to perform a Linux task and stick with it for years because it works, and there’s rarely a good time to look for a better approach. You might create a directory, change into it, create another directory, and repeat the process. Or you might copy a tarball into /opt just to extract it there.
These habits aren’t wrong, but they add unnecessary steps. Across multiple servers, those extra commands add up. They also make shell scripts longer and introduce more opportunities for typos.