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. How do you send GET and POST requests with curl?

    curl URL sends a GET. For a POST with JSON use curl -X POST -H 'Content-Type: application/json' -d '{...}' URL. Adding -d already makes the request a POST, and -i or -v shows the response headers.

    BeginnerQuick answer1 min read
  2. What do the curl flags -s, -L, -o, -f and -I do?

    -s hides the progress meter, -L follows redirects, -o saves the body to a file, -f makes curl fail with a non-zero exit code on HTTP errors, and -I fetches only the headers. A common combination in scripts is curl -fsSL.

    IntermediateQuick answer1 min read