Essential cookies keep authentication working. With your permission, we also use analytics cookies to understand and improve the product. Read our Privacy Policy

DataEngPrep.tech
QuestionsPracticeAI CoachDashboardPricingBlog
ProLogin
Home/Questions/General/Other/Shell: command to check processes running in the background?

Shell: command to check processes running in the background?

General/Othereasy2 min read

Reviewed by Aditya Kumar · Last reviewed 2026-03-24

To check processes running in the background, use the jobs command for processes launched from your current shell session, or ps (Process Status) for a system wide view of all processes. Interactive…

🤖 Analyze Your Answer
Frequency
Low
Asked at 1 company
Category
243
questions in General/Other
Difficulty Split
151E|43M|49H
in this category
Total Bank
1,863
across 7 categories
Asked at these companies
Citi
Key Concepts Tested
python

Why This Question Matters

This easy-level General/Other question appears frequently in data engineering interviews at companies like Citi. While less common, it tests deeper understanding that distinguishes strong candidates. Mastering the underlying concepts (python) will help you answer variations of this question confidently.

How to Approach This

Start by clearly defining the core concept being asked about. Interviewers want to see that you understand the fundamentals before diving into implementation details. Structure your answer with a definition, then explain the practical application with a concise example. The expert answer includes a code example that demonstrates the implementation pattern.

Expert Answer
327 wordsIncludes code

To check processes running in the background, use the jobs command for processes launched from your current shell session, or ps (Process Status) for a system-wide view of all processes. Interactive tools like top or htop also provide real-time process monitoring.

Mechanics / "Why"

The jobs command lists processes that were started in the background (using &) within your current shell session. It shows their job ID, status (e.g., Running, Stopped), and the command itself. For processes running independently of your current shell, or those started by other users or services, ps is essential. Common ps invocations include ps aux (show all processes for all users, including those without a controlling terminal) or ps -ef (full format listing). You can pipe ps output to grep to filter for specific processes, for example, ps aux | grep 'python my_script.py'. pgrep offers a more direct way to find process IDs by name, like pgrep -l python. top and htop provide a dynamic, real-time view of running processes, CPU, and memory usage, which is invaluable for identifying resource-intensive tasks.

Concrete Example / Trade-offs

When running a long-running data transformation script, such as a PySpark job or a dbt run, you might launch it with nohup python my_etl.py & to ensure it continues even if your terminal closes. You'd then use jobs to see its status within that shell, or ps aux | grep my_etl.py to find its system-wide process ID (PID) and monitor it. The trade-off is scope: jobs is quick for your immediate shell context, while ps offers deep system visibility, crucial for debugging issues like a runaway Spark driver process or a stuck Kafka consumer.
# Example: Find all Python processes
ps aux | grep python

In the interview, also mention…

Discuss related commands like kill (to terminate processes), disown (to remove a background job from the shell's job table), fg (foreground), and bg (background) to demonstrate a comprehensive understanding of process management.
⚡
Pro Tip

Red Flag: Only knowing one command. Pro-Move: 'ps aux for full view; we use pgrep in monitoring scripts; disown for long-running detached jobs.'

Want all answers as a PDF for offline study?
Seven focused volumes with 750+ in-depth answers — Answer Vault →

Related General/Other Questions

hardHave you worked on Data Warehousing projects?FreemediumHow would you read data from a web API? What steps would you follow after reading the data?FreehardRetrieve the most recent sale_timestamp for each product (Latest Transaction).FreehardWhat is the difference between OLTP and OLAP?FreemediumWhat is the difference between SQL and NoSQL databases?Free

Level up your prep

Recommended
Educative
Educative Unlimited

800+ hands-on courses — Grokking System Design, Coding Patterns, and AI mock interviews for your DE loop.

Start learning →

Some links below are affiliate links. If you buy through them we may earn a small commission at no extra cost to you — it helps keep DataEngPrep free.

According to DataEngPrep.tech, this is one of the most frequently asked General/Other interview questions, reported at 1 company. DataEngPrep.tech maintains an editor-reviewed database of 1,863 data engineering interview questions across 7 categories.

← Back to all questionsMore General/Other questions →
Categories
All QuestionsSQLSpark / Big DataPython / CodingSystem DesignCloud / ToolsBehavioral
By Company
AmazonGoogleDatabricksSnowflakeAWSAzureMicrosoftNetflixUberTCS
Interview Guides
All GuidesTop SQL QuestionsTop Spark QuestionsPySpark QuestionsTop Python QuestionsTop System DesignKafka QuestionsAirflow QuestionsSQL Window FunctionsETL QuestionsData Modeling
Products
AI Interview CoachAnswer AnalyzerSQL PlaygroundResume AnalyzerAnswer Vault PDFsPricing
Company
About & Editorial PolicyContact UsAI DisclosureDisclaimerTerms of ServicePrivacy Policy
© 2026 DataEngPrep.tech. All rights reserved.
AboutBlogContactDisclaimer