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. What extra information does stat show compared to ls -l?

    stat prints a file's full metadata: exact size, blocks, inode number, link count, permissions in octal and symbolic form, owner, and three timestamps (access, modify, change). ls -l shows only a short summary.

    IntermediateQuick answer1 min read
  2. What is the difference between cp -r and cp -a?

    cp -r copies directories recursively but new files get fresh timestamps, your ownership and default permissions. cp -a (archive) also preserves permissions, ownership, timestamps and symlinks, so the copy matches the original as closely as possible.

    IntermediateQuick answer1 min read