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: change permissions?

Shell: change permissions?

General/Othereasy2 min read

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

To change file or directory permissions in a Unix like system, use the chmod (change mode) command. It allows specifying permissions numerically (octal) or symbolically, controlling read, write, and…

🤖 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

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.

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
419 wordsIncludes code

To change file or directory permissions in a Unix-like system, use the chmod (change mode) command. It allows specifying permissions numerically (octal) or symbolically, controlling read, write, and execute access for the owner, group, and others.

Mechanics of chmod

The chmod command takes a mode and a file/directory path.
* Numeric (Octal) Mode: This is the most common and precise method. Permissions are represented by a three-digit octal number, where each digit corresponds to the owner, group, and others, respectively. Each digit is a sum of:
* 4 for read (r)
* 2 for write (w)
* 1 for execute (x)
For example, 755 means:
* Owner: 4+2+1 = 7 (read, write, execute)
* Group: 4+1 = 5 (read, execute)
* Others: 4+1 = 5 (read, execute)
* Symbolic Mode: This method uses letters to specify changes.
* Who: u (user/owner), g (group), o (others), a (all)
* Operation: + (add permission), - (remove permission), = (set exact permission)
* Permissions: r (read), w (write), x (execute)
Example: chmod u+x,g-w my_script.sh adds execute permission for the owner and removes write permission for the group.

To change the owner or group of a file/directory, use the chown command (e.g., chown newuser:newgroup myfile.txt). For recursive changes to a directory and its contents, use the -R flag with chmod or chown, like chmod -R 644 my_data_directory/.

Best Practices and Data Engineering Context

The principle of least privilege is paramount: grant only the permissions necessary for a task.
* Data Files: A common permission for data files (e.g., CSVs, Parquet files, logs) is 644 (rw-r--r--). This allows the owner to read and write, while the group and others can only read. This prevents accidental modification or deletion by unauthorized users.
* Executable Scripts/Directories: For shell scripts or directories, 755 (rwxr-xr-x) is typical. The owner can read, write, and execute. Group and others can read and execute. Directories require execute permission for users to cd into them and list their contents.

Avoid 777 (rwxrwxrwx) as it grants full read, write, and execute access to everyone, posing a significant security risk for sensitive data or critical scripts in production data pipelines.

# Set a script to be executable by owner, readable/executable by group/others
chmod 755 my_data_processor.sh

In the interview, also mention that proper file permissions are a fundamental aspect of data security and compliance, ensuring that sensitive data (e.g., in a data lake or logs) is protected from unauthorized access or modification by service accounts or users within a data platform.

⚡
Pro Tip

Red Flag: chmod 777. Pro-Move: '755 for scripts, 600 for secrets; we use umask in CI to enforce defaults.'

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