3.2 Networking, Archives, and Background Tasks
The previous section focused on whether programs and services are running. This section focuses on the surrounding operating skills: is the port responding? How do you package files? How does configuration reach a program? How do jobs run later or keep running in the background?
Network diagnosis
Useful commands:
curl -I http://localhost
ss -ltn
ip addr
ping example.com
ssh user@server
scp file.txt user@server:/tmp/curl: request an HTTP address.ss -ltn: list listening TCP ports.ip addr: show network interface addresses.ping: test reachability, though some servers disable ICMP.ssh: log into a remote machine.scp: copy a file to a remote machine.
When diagnosing a service, do not stop at "the process exists." A stronger check connects several signals: the process exists, the service manager reports a healthy state, logs show no obvious errors, the port is listening, and a request gets a response.
Archives, compression, and environment variables
tar -czf app.tar.gz app/
tar -xzf app.tar.gz
export APP_ENV=dev
echo $APP_ENV
envtar commonly packages directories, and gzip commonly compresses them. export sets an environment variable visible to the current shell and child processes it starts. Many programs read configuration from environment variables, such as runtime environment, port, database address, or feature flags.
Scheduled jobs and background sessions
You will also encounter:
cron: run tasks on a schedule.nohup command &: keep a command running in the background.screen/tmux: keep a remote session alive.
You do not need to master these on day one, but know that they solve "run for a long time" and "run on a schedule" problems.