InterviewStack.io LogoInterviewStack.io

Command Line and Shell Scripting Questions

Practical skills using command line interfaces and writing simple shell scripts for automation and system administration across operating systems. For Linux this includes navigation and file operations, file permissions, process and service inspection, log viewing, package and systemctl management, common text processing and search utilities such as grep, find, sed, and awk, piping and redirection, environment variables, command substitution, and interactive use of editors and remote access tools. Shell scripting fundamentals include variables, conditionals, loops, functions, argument handling, basic debugging, and using bash to automate repetitive tasks. The scope also covers essential Windows command line and shell basics where relevant, including interactive commands, simple PowerShell cmdlets for process and service management, file and permission commands, and differences in syntax and environment when performing equivalent administrative tasks on Windows. Candidates may be evaluated on writing short scripts, composing command pipelines to accomplish tasks, and explaining tradeoffs between interactive commands and scripted automation.

MediumTechnical
89 practiced
Create a robust pipeline using `find` with `-print0` and `xargs -0` to locate Parquet files under /data/raw older than 90 days and compress or rewrite them with an internal Parquet compression codec. Handle filenames with special characters, and discuss the pros and cons of using gzip vs rewriting parquet with compression.
EasyTechnical
86 practiced
Explain the Linux file permission and ownership model: user/group/other, rwx bits and numeric modes. Given a dataset directory that should allow group access to 'data' group but deny world access, provide the commands to set permissions, change ownership to user 'etl' and group 'data', set a setgid bit so new files inherit the group, and explain edge cases (umask, ACLs).
EasyTechnical
89 practiced
Explain how grep works and write a bash pipeline (using grep, awk, sort, uniq as needed) to find all log lines in /var/log/app.log from the last 24 hours that contain the word 'timeout' (case-insensitive) and then count unique source IP addresses mentioned in those lines. Assume log lines contain ISO8601 timestamps and IPv4 addresses.
EasyTechnical
86 practiced
You must schedule a nightly ETL job to run at 02:30 every day using cron. Provide the crontab line you would add, explain the five fields, how to ensure the job runs with the correct PATH and environment variables, and how you'd rotate stdout/stderr logs generated by the job.
EasyTechnical
76 practiced
On Windows, write PowerShell commands to list running processes sorted by CPU usage, filter processes using more than 20% CPU, stop a specific process gracefully by name, and export the filtered list to CSV. Also explain differences between PowerShell piping and bash piping.

Unlock Full Question Bank

Get access to hundreds of Command Line and Shell Scripting interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.