Interview Q&A / Linux & Shell

INTERVIEW Q&A · 63 QUESTIONS

Linux & Shell interview questions

Permissions, processes, pipes and the commands you are expected to know cold.

  1. When would you use cut instead of awk?

    cut extracts fixed fields by a single-character delimiter or character positions and is simple and fast. awk handles runs of spaces, conditions and calculations. Use cut for neat CSV-like data and awk for messy whitespace-aligned output.

    IntermediateQuick answer1 min read
  2. What is a systemd timer, and how does it differ from cron?

    A systemd timer is a .timer unit that starts a matching .service on a schedule or after boot. Unlike cron, its output goes to the journal, it can run missed jobs after downtime with Persistent=true, and it supports dependencies and resource limits.

    AdvancedQuick answer1 min read
  3. What is SSH local port forwarding, and when is it used?

    ssh -L local_port:target_host:target_port user@server opens a port on your machine and tunnels traffic through the SSH server to the target. It lets you reach a service, such as a private database, that is only accessible from the server's network.

    AdvancedQuick answer1 min read