UNIX Tutorial

  • Unix / Linux for Beginners
  • Unix / Linux - Home
  • Unix / Linux - Getting Started
  • Unix / Linux - File Management
  • Unix / Linux - Directories
  • Unix / Linux - File Permission
  • Unix / Linux - Environment
  • Unix / Linux - Basic Utilities
  • Unix / Linux - Pipes & Filters
  • Unix / Linux - Processes
  • Unix / Linux - Communication
  • Unix / Linux - The vi Editor
  • Unix / Linux Shell Programming
  • Unix / Linux - Shell Scripting
  • Unix / Linux - What is Shell?
  • Unix / Linux - Using Variables
  • Unix / Linux - Special Variables
  • Unix / Linux - Using Arrays
  • Unix / Linux - Basic Operators
  • Unix / Linux - Decision Making
  • Unix / Linux - Shell Loops
  • Unix / Linux - Loop Control
  • Unix / Linux - Shell Substitutions
  • Unix / Linux - Quoting Mechanisms
  • Unix / Linux - IO Redirections
  • Unix / Linux - Shell Functions
  • Unix / Linux - Manpage Help
  • Advanced Unix / Linux
  • Unix / Linux - Regular Expressions
  • Unix / Linux - File System Basics
  • Unix / Linux - User Administration
  • Unix / Linux - System Performance
  • Unix / Linux - System Logging
  • Unix / Linux - Signals and Traps
  • Unix / Linux Useful Resources
  • Unix / Linux - Questions & Answers
  • Unix / Linux - Useful Commands
  • Unix / Linux - Quick Guide
  • Unix / Linux - Builtin Functions
  • Unix / Linux - System Calls
  • Unix / Linux - Commands List
  • Unix / Linux - Useful Resources
  • Unix / Linux - Discussion
  • Selected Reading
  • UPSC IAS Exams Notes
  • Developer's Best Practices
  • Questions and Answers
  • Effective Resume Writing
  • HR Interview Questions
  • Computer Glossary

Unix / Linux Questions and Answers

Unix Questions and Answers has been designed with a special intention of helping students and professionals preparing for various Certification Exams and Job Interviews . This section provides a useful collection of sample Interview Questions and Multiple Choice Questions (MCQs) and their answers with appropriate explanations.

Questions and Answers

unix assignment questions with answers

  • Onsite training

3,000,000+ delegates

15,000+ clients

1,000+ locations

  • KnowledgePass
  • Log a ticket

01344203999 Available 24/7

Top 40 Unix Interview Questions and Answers

Explore a comprehensive collection of Unix Interview Questions and Answers designed to help you ace your next job interview. Whether you're a seasoned Unix pro or a newcomer, our blog offers valuable insights and expert guidance on handling Unix Interview Questions with confidence. Prepare for success with our in-depth knowledge and expert tips.

stars

Exclusive 40% OFF

Training Outcomes Within Your Budget!

We ensure quality, budget-alignment, and timely delivery by our expert instructors.

Share this Resource

  • LINUX Fundamentals Course
  • macOS Mojave Troubleshooting and Support Training
  • Linux Shell Programming
  • UNIX Shell Programming
  • Ubuntu Linux Server Administration Training

course

Table of Contents  

1) UNIX Interview Questions on basic UNIX commands 

2) UNIX Interview Questions on file and directory operations 

3) UNIX Interview Questions on UNIX permissions and ownership 

4) UNIX Interview Questions on process management 

5) UNIX Interview Questions on UNIX shell scripting 

6) UNIX Interview Questions on advanced UNIX concepts 

7) Conclusion 

UNIX Interview Questions on basic UNIX commands   

This section of the blog will expand on some commonly asked UNIX Commands interview questions. 

Q1) How do you list files in a directory?   

Ans: The ls command is fundamental in UNIX. By default, when executed, it displays the files and directories in the current directory. It provides a quick visual overview of directory contents, ensuring efficient navigation and file management. 

Q2) How can you list files with detailed information?   

Ans: To get a detailed listing of files, you can employ the ls -l command. This displays permissions, the number of links, file owner, file group, file size, and the time of the last modification. It's especially useful when monitoring file details and attributes. 

Q3) How do you navigate to parent or root directories?   

Ans: The command cd .. is employed to navigate to the parent directory, offering a step backwards in the directory tree. To directly navigate to the root directory, which is the base of the file system hierarchy, you use cd /. 

Q4) How do you view the contents of a file?   

Ans: The cat command, short for "concatenate and display", is versatile. Primarily, it is used to view the contents of a file, streaming its content to the standard output. This command provides a quick way to read small files or check file content without opening in an editor. 

Q5) How would you display the first 10 lines of a file?   

Ans: Utilising the head command proves beneficial for this. By default, executing head followed by a filename displays the file's initial ten lines. It's a great way to preview the beginning of large files or logs. 

Q6) How can you view the last lines of a file?   

Ans: The tail command serves this purpose efficiently. In its standard form, it exhibits the last ten lines of a file. It is particularly handy for real-time monitoring logs or checking recent file updates. 

Q7) How do you create an empty file in UNIX?   

Ans: The touch command is the tool of choice. When executed with a filename, e.g., touch filename.txt, it either creates an empty file or updates the timestamp of an existing one. It's a swift way to generate files or refresh their access times. 

Q8) How can you delete a file?   

Ans: To delete a file, the rm command is used. For example, executing rm filename.txt will remove the specified file after confirmation. Care should be exercised as this deletion is irreversible in standard file systems. 

Q9) How would you search for a specific pattern or word in a file?   

Ans: The grep command, derived from "Global Regular Expression Print", is indispensable. To search for a pattern within a file, you'd use grep "pattern" filename.txt. It scans the file line by line, printing lines that match the specified pattern – an essential tool for data parsing and content discovery. 

Q10) How can you search for files by name in a directory?   

Ans: The find command stands out for this task. For example, find . -name "example.txt" will search the current directory (denoted by ".") and its subdirectories for a file named "example.txt". This highly powerful command offers various flags and parameters for refined searching. 

Unlock the power of UNIX with our UNIX Fundamentals Course – join today!  

UNIX Interview Questions on file and directory operations   

This section of the blog will expand on some commonly asked UNIX Interview Questions and answers on file and directory operations.   

Q11) How do you create a directory in UNIX?   

Ans: In UNIX , the mkdir command is used to create directories. By executing mkdir directory_name, a new directory with the given name is created in the current location. The command is simple yet powerful, with options like -p, which allows the creation of nested directories in a single command. It's essential for organising files and ensuring structured data storage. 

Q12) How do you remove a directory?   

Ans: Directories can be removed using the rmdir command for empty directories. For instance, rmdir directory_name will remove the named directory, provided it's empty. However, if you need to remove a directory and its contents, the rm command with the -r (recursive) option, like rm -r directory_name, becomes useful. Caution is advised, as this operation is irreversible and can quickly delete large amounts of data. 

Q13) How do you move or rename a file or directory?   

Ans: The mv command serves the dual purpose of moving and renaming files or directories. To rename a file, mv old_filename new_filename is used. Similarly, to move a file to a different directory, the format is mv filename target_directory/. The same logic applies to directories. It’s a versatile command that aids in organising and re-structuring file locations and names. 

Q14) How can you copy files or directories?   

Ans: To duplicate files or directories, UNIX offers the cp command. For copying files, the syntax is cp source_file destination_directory/. If duplicating a directory, the -r option (meaning recursive) must be added, as in cp -r source_directory destination_directory/. This ensures all sub-files and sub-directories are replicated too. The cp command is fundamental when backing up data or creating duplicate research resources. 

Q15) How would you find the size of a file or directory?   

Ans: The du command, standing for "disk usage", can be employed to ascertain the size of files and directories. du -sh filename would display the size of a file, while du -sh directory_name reveals the total size of a directory. The -s provides a summary and -h displays sizes in a human-readable format (like KB, MB). It's an invaluable command for monitoring space utilisation and managing storage effectively. 

Q16) How can you create a symbolic link to a file or directory?   

Ans: Symbolic links (often called symlinks or soft links) can be crafted using the ln command with the -s option. The general form is ln -s target source_link. This creates a symbolic link named source_link that points to the target. Unlike hard links, symbolic links can reference directories or files across different file systems. They are especially useful for creating shortcuts or ensuring multiple paths to a single resource. 

Unlock the power of UNIX: Sign up for our UNIX Shell Programming Course today!  

UNIX Interview Questions on UNIX permissions and ownership   

This section of the blog will expand on some commonly asked UNIX Interview Questions and answers on permissions and ownership.   

Q17) How are UNIX file permissions represented?   

Ans: UNIX file permissions are typically represented using a combination of characters: r (read), w (write), and x (execute). These permissions are set for three different categories: the file's owner (user), the file's group (group), and others (other). A typical permission set might look like rw-r--r--, where the owner has read and write permissions, while the group and others have only read permissions. This symbolic notation can also be represented numerically, with read as 4, write as 2, and execute as 1, making the previous example 644. 

Q18) How do you change file permissions?   

Ans: The chmod command, short for "change mode", is employed to modify file or directory permissions. You can use symbolic or numerical notation with this command. For instance, chmod u+x filename adds execute permission for the user (owner), while chmod 755 filename sets permissions to rwxr-xr-x. The command offers flexibility, allowing users to control access to their files and directories precisely. 

Q19) How can you change the owner or group of a file?   

Ans: The chown command is used to change the owner of a file or directory. For instance, chown newowner filename would change the file's owner to "newowner". If you want to change both the owner and the group simultaneously, you will use a syntax like chown newowner:newgroup filename. For altering only the group, the chgrp command is used. As with most UNIX commands, care should be taken with these tools, ensuring that ownership is only granted to trusted users. 

Q20) What is the significance of the 'sticky bit' in permissions?   

Ans: The sticky bit is a permission setting that safeguards the files within a directory. When set on a directory, it ensures that only the owner of a file can either delete or rename the file, irrespective of the directory's permissions. This is especially useful in shared directories, like /tmp, preventing users from accidentally or maliciously deleting others' files. Symbolically, the sticky bit is represented as a t in the execute field for others, such as drwxrwxrwt. 

Q21) What's the difference between a hard link and a symbolic (or soft) link in terms of permissions?   

Ans: A hard link is an additional reference to the same inode on the disk, meaning it effectively "points" to the same data. Permissions changes on a hard link directly modify the original file since they reference the same data. Conversely, a symbolic (or soft) link is a separate file that points to another file's location. Permissions for the symlink are independent of the target file. Additionally, symlinks have their own set of permissions, but these largely affect the symlink itself and not the access to the target file. 

Q22) How can you set the setuid, setgid, and sticky bits using chmod?  

A: The setuid, setgid, and sticky bits are special permissions in UNIX that allow for enhanced security and functionality: 

a) setuid: When set on an executable file, it ensures that the program runs with the privileges of the owner of the file rather than the user who runs it. Using chmod, you can set the setuid bit with the symbol u+s or numerically as 4000. For instance, chmod u+s filename or chmod 4755 filename. 

b) setgid: This works similarly to setuid but for group permissions. It can be set on a file with g+s or 2000. When set on a directory, it ensures that files created within inherit the directory's group ownership. Use the command like chmod g+s directoryname or chmod 2755 directoryname. 

c) sticky bit: As mentioned earlier, it ensures that only the file owner can delete or rename files in a directory where it's set. You can set the sticky bit with o+t or numerically as 1000. For example, chmod o+t directoryname or chmod 1755 directoryname. 

Master UNIX administration with our expert-led Administrating UNIX Systems Course – join now!  

UNIX Interview Questions on process management   

This section of the blog will expand on some commonly asked UNIX Interview Questions and answers on process management.     

Q23) What is a 'process' in UNIX?  

Ans: In UNIX, a 'process' is a running instance of a program, possessing its memory space and assigned a unique process ID (PID). It can be in various states, like running, sleeping, or terminated, and is managed by the kernel. 

Q24) How can you view running processes?  

Ans: The ps command displays currently running processes, showing details like PID, terminal type, CPU time, and the command itself. For a comprehensive list, ps -ef or ps aux is commonly used. 

Q25) How can you send signals to processes?  

Ans: The kill command sends signals to processes, typically to terminate. For example, kill -9 PID sends the SIGKILL signal to terminate the process with the specified PID forcefully. 

Q26) Explain 'foreground' and 'background' processes.  

A: 'Foreground' processes run interactively, occupying the terminal until they are complete. Conversely, 'background' processes run behind the scenes, allowing terminal usage. Using & after a command starts it in the background. 

Q27) What is the 'nice' value in process management?  

Ans: The 'nice' value determines a process's priority. A process with a high nice value is 'nicer', getting less CPU time. Conversely, a lower nice value gets more CPU time. The nice command adjusts this value. 

Q28) How can you change the priority of a running process in UNIX?  

Ans: In UNIX, the renice command allows users to change the priority of a running process. Adjusting the 'nice' value influences the process's scheduling priority. For example, renice +5 PID would decrease the process's priority with the given PID, while renice -5 PID would increase its priority. Having the appropriate permissions is essential when trying to change the priority of processes not owned by the user. 

Unlock the power of Linux: Dive into our Linux Shell Programming Course today!  

UNIX Interview Questions on UNIX shell scripting   

This section of the blog will expand on some commonly asked UNIX Interview Questions and answers on shell scripting. 

Q29) What is a shell script in UNIX?  

Ans: A shell script is a sequence of commands that are stored in a file that the UNIX shell can execute. It automates repetitive tasks, enhances the command's capabilities, and can combine multiple utilities for complex operations. 

Q30) How do you make a shell script executable?  

Ans: To make a shell script executable, use the chmod command followed by +x. For instance, chmod +x scriptname.sh will grant execute permissions to the script. 

Q31) What's the significance of the '#!' (shebang) at the beginning of a script?  

Ans: The #! (shebang) at a script's start specifies the interpreter's path for executing the script. For example, #!/bin/bash instructs the system to use the Bash shell. 

Q32) How would you pass arguments to a shell script?  

Ans: Arguments can be passed directly after the script's name, like scriptname.sh arg1 arg2. Inside the script, $1, $2, etc., represent these arguments. 

Q33) What's the difference between '$#' and '$*' in shell scripting?  

Ans: In shell scripting, $# returns the number of arguments passed to a script, while $* displays all arguments as a single string. 

Q34) How can you check if a particular file exists in a shell script?  

Ans: To check if a file exists, use the -f test operator, as in [ -f filename ]. If true, it confirms the file's presence. 

UNIX Interview Questions on advanced UNIX concepts  

This section of the blog will expand on some commonly asked interview questions and answers on advanced UNIX concepts.  

Q35) What is the purpose of the 'cron' utility in UNIX?  

Ans: The cron utility in UNIX is a time-based job scheduler. It allows users and administrators to run scripts, commands, or jobs at predetermined intervals or specific times. Jobs can be scheduled to run by the minute, hour, month, week, or any combination thereof. Scheduled tasks are typically defined in a crontab file. The utility is indispensable for automating repetitive tasks, like taking regular backups, clearing temp directories, or fetching updates. 

Q36) Explain 'inodes' and their significance in UNIX.   

Ans: An inode (index node) in UNIX is a data structure that stores metadata about a file or directory except for its name or actual data. This metadata includes attributes like permissions, ownership, timestamps, and the location of data blocks. Every file or directory has a unique inode number within a filesystem. Inodes are significant because they underpin the UNIX filesystem's structure, allowing the system to manage and retrieve files efficiently. Operations that seem name-based, like renaming, often manipulate inodes behind the scenes. 

Q37) What is a 'daemon' in UNIX?   

Ans: A daemon is a background process or service that runs continuously, typically without any direct user interaction. Daemons perform tasks or provide services essential for the system's smooth running. Examples include sshd (secure shell daemon) for remote connections or crond for scheduling tasks. The naming convention for daemons usually ends in 'd'. They are crucial for server environments where services must run persistently, awaiting requests or performing regular duties. 

Q38) Describe 'pipes' and their usefulness in UNIX.   

Ans: 'Pipes', denoted by the | symbol, are a fundamental concept in UNIX that enables the output of one command to be fed as the input to another. This allows users to chain multiple commands together in sequence, effectively creating on-the-fly data processing streams. For instance, cat file.txt | grep "search_term" would display lines from file.txt containing "search_term". Pipes exemplify the UNIX philosophy of small, modular utilities that can be combined to produce complex results, promoting efficiency and reusability. 

Q39) How does UNIX handle process management and what is a 'zombie' process?   

Ans: UNIX employs a parent-child relationship for processes. When a process (parent) spawns another process (child), it's the parent's responsibility to retrieve the child's exit status. If the parent fails, the child remains in the process table, turning into a 'zombie' process. These zombies consume system resources without performing useful work. They can be identified using the ps command with statuses marked 'Z'. While individual zombies aren't harmful, they can clutter the process table in large numbers or if persistently generated, warranting intervention. 

Q40) What is 'IPC' in UNIX and why is it important?  

Ans: 'IPC' stands for Inter-Process Communication. It refers to the various mechanisms UNIX provides to allow processes to communicate with each other, either within the same system or across different systems. IPC mechanisms include pipes (both named and unnamed), message queues, semaphores, shared memory, and sockets. These tools are paramount because many applications and systems must coordinate tasks among multiple processes.   

UNIX Fundamental

Conclusion  

UNIX is a versatile Operating System with a rich history. By understanding the foundational concepts and commands, you are better equipped to tackle advanced tasks and troubleshooting in UNIX environments. We hope the aforementioned UNIX Interview Questions will be instrumental in your preparation for UNIX-related interviews or roles. 

Unlock your potential in the world of Linux with our wide range of Linux Training Courses . Explore our offerings and sign up today!  

Frequently Asked Questions

Upcoming it infrastructure & networking resources batches & dates.

Thu 25th Apr 2024

Thu 22nd Aug 2024

Thu 28th Nov 2024

Get A Quote

WHO WILL BE FUNDING THE COURSE?

My employer

By submitting your details you agree to be contacted in order to respond to your enquiry

  • Business Analysis
  • Lean Six Sigma Certification

Share this course

New year big sale, biggest christmas sale .

red-star

We cannot process your enquiry without contacting you, please tick to confirm your consent to us for contacting you about your enquiry.

By submitting your details you agree to be contacted in order to respond to your enquiry.

We may not have the course you’re looking for. If you enquire or give us a call on 01344203999 and speak to our training experts, we may still be able to help with your training requirements.

Or select from our popular topics

  • ITIL® Certification
  • Scrum Certification
  • Change Management Certification
  • Business Analysis Certification
  • Microsoft Azure
  • Microsoft Excel & Certification Course
  • Microsoft Project
  • Explore more courses

Press esc to close

Fill out your  contact details  below and our training experts will be in touch.

Fill out your   contact details   below

Thank you for your enquiry!

One of our training experts will be in touch shortly to go over your training requirements.

Back to Course Information

Fill out your contact details below so we can get in touch with you regarding your training requirements.

* WHO WILL BE FUNDING THE COURSE?

Preferred Contact Method

No preference

Back to course information

Fill out your  training details  below

Fill out your training details below so we have a better idea of what your training requirements are.

HOW MANY DELEGATES NEED TRAINING?

HOW DO YOU WANT THE COURSE DELIVERED?

Online Instructor-led

Online Self-paced

WHEN WOULD YOU LIKE TO TAKE THIS COURSE?

Next 2 - 4 months

WHAT IS YOUR REASON FOR ENQUIRING?

Looking for some information

Looking for a discount

I want to book but have questions

One of our training experts will be in touch shortly to go overy your training requirements.

Your privacy & cookies!

Like many websites we use cookies. We care about your data and experience, so to give you the best possible experience using our site, we store a very limited amount of your data. Continuing to use this site or clicking “Accept & close” means that you agree to our use of cookies. Learn more about our privacy policy and cookie policy cookie policy .

We use cookies that are essential for our site to work. Please visit our cookie policy for more information. To accept all cookies click 'Accept & close'.

Get discounts on data, AI, and programming courses. View offers

{{ activeMenu.name }} courses & tutorials

  • Android Development
  • Data Structures and Algorithms

Recent Articles

16 Best JavaScript Projects for Beginners [With Source Code]

  • Artificial Intelligence
  • Machine Learning
  • Data Science
  • Apache Spark
  • Deep Learning
  • Microsoft Power BI

16 Best Data Science Courses Online in 2024 [Free + Paid]

  • Adobe After Effects
  • Game Design
  • Design Thinking
  • User Interface Design
  • User Experience Design
  • Information Architecture
  • Color Theory
  • Interaction Design

7 Best Programming Languages for Game Development in 2024

  • Linux System Administration
  • Computer Networks
  • System Architecture
  • Google Cloud Platform
  • Microsoft Azure

Best VPN for 2024: Full Rankings

  • Programming

Don't have an account? Sign up

Forgot your password?

Already have an account? Login

Have you read our submission guidelines?

Go back to Sign In

  • Career Development

unix assignment questions with answers

Top Unix Interview Questions and Answers in 2024

Most interviewers look for candidates who have strong fundamental knowledge. If you are clear with the concepts, you can get through any trick questions or programming-related questions. Most of the time, the next questions are based on the previous answers, and that’s how interviewers build a conversation. Since Unix is a shell-based scripting language, you should know about bsh, csh, ksh, and bash. Interviewers also ask a lot about the Kernel and its purposes. Besides these two important concepts, Unix is all about commands and how to use the commands correctly.

  • Features of Unix

Before we get onto Unix interview questions, let us introduce Unix. It is useful if the interviewer asks you, ‘What is Unix?’. You can brief them on Unix and also give some features to impress them.

Unix is the most sought-after operating system because of its high reliability, scalability, and powerful features. Apple uses Unix, HP, AT&T, and many more big companies and backbone various data centers. The parent company of Unix is AT&T. Unix is free and easily accessible. Some features of Unix are:

  • Multiple users can get access by connecting to terminals.
  • High-level language, hence portable, and works across architectures.
  • Multitasking; many users can run various programs and processes parallely.
  • Users communicate with the system using Unix Shell translated to Kernel.
  • It follows a hierarchical file structure starting with a root directory represented by a slash (/).
  • Top Unix Interview Questions and Answers

We have answered the most commonly asked Unix interview questions below to help you get a fair idea of your interview. Not all questions will be asked in a single interview, but being prepared will help you better answer the questions. Some commonly asked Unix interview questions are:

1. What is the full form of UNIX?

Answer: Uniplexed Information & Computing System.

2. What are the common shells of Unix? Name their corresponding indicators.

Answer: 

3. What is a Unix shell?

Answer: Shell is a program or interface between system and user. In other words, it is the layer that understands both human and system language and executes commands entered by a user. It is also called a command interpreter.

4. What is the typical syntax of a UNIX command?

Answer: In general, the syntax of a UNIX command is:

Unix For Beginners

5. What does the symbol ‘*’ indicate to directories and files?

Answer: We use star character(*) for wildcards. Giving star after a command means including all the directories, folders, and files. For example, if you have to select all the files in a particular directory, you can give the command as:

6. Can you tell what a directory is? Command to create a Unix directory.

Answer: The directory is a structure that has a list of all the files inside it. The first directory is called the root directory. We represent the root using the slash (/) symbol. A directory can be created using the mkdir command by specifying the directory name:

7. What is the use of ls -l command?

Answer: ls -l is the long listing format to list all the information about the files in a directory. It displays all the information like the access, owner, timestamp, etc. Example:

dr-xr-xr-x 4 root root 4023 Mar 12 16:23 home

8. How to remove a directory in UNIX?

Answer: To remove a directory, use rmdir followed by the directory name. Example:

9. Name a few commands and their use?

Answer: Some common commands are:

10. What is the purpose of the kernel?

Answer: A kernel is the heart of Unix. It manages the hardware and software of the computer. The kernel manages the RAM to ensure all the programs run smoothly. It also manages access and use of different peripherals connected to the computers and manages processor time, task scheduling, and system files.

11. What does the command rm -r* do?

Answer: rm is to remove files

-r includes all the sub-directories of the current directory

* indicates all the files inside all the directories within

So, rm -r * removes all the files within the directory, including those in the sub-directories.

12. What is a Bourne shell? Explain with an example.

Answer: Bourne shell is a shell CLI for OS. It is represented by /bin/sh. Bourne shell executes each line of code till the end of the line (EOL) is found. Bourne shell doesn’t support arithmetic functions. Example:

echo “Hello, how are you?”

read response

13. What is the ‘cmp’ command? How is it different from ‘diff’?

Answer: cmp is used to compare files and gives out the exact line number & column number where the files differ.

diff is used to compare directories and list the different files and sub-directories in the directories being compared.

14. What is a shell script? Can you write a small program to print a message, “Good morning”?

Answer: A shell script is a program run by the Unix command line (CLI). The program to print ‘Good Morning’ is:

mymsg = Good morning

echo $mymsg

15. What does the setenv command do?

Answer: setenv defines the value of environment variables. It is a built-in function of csh (C shell). We can specify the argument (VAR), so it sets the particular environment variable. If no arguments are specified, setenv displays all the environment variables with their respective values.

16. How do you end a switch case statement in Unix?

Answer: It is done by reversing the letters of the word case, i.e., esac.

17. Give an example of a file system (hierarchy) in Unix.

Answer: Unix follows many standards for its file system. The first directory is ‘root’, represented with a forward slash (/). All the binaries that need to be available in single-user mode are contained in the /bin folder. Boot loaders like kernel, initrd are stored in /boot directory. Refer to the file hierarchy Wikipedia page for more.

18. What are the uses of head and tail commands?

Answer: The head command is used for printing the first n lines of a file onto the terminal:

head 7 test.txt

By default (i.e., when you don’t specify a number), ten lines are printed.

The tail command prints the last n lines of a file. By default, n is ten unless specified. We can specify more than one file, in which case the output is displayed along with the file name.

tail 15 test.txt

19. What will the following command do: $ grep “[^aeiou]” myfile

Answer: The command will match all lines that do not contain a vowel from the file ‘myfile’.

20. Explain the following piping command:

Answer: cat myfile | grep -i hi | sort – r

The command displays (cat) all the matches of ‘hi’ irrespective of the case (-i) and sorts the occurrences in the reverse order (-r).

21. What is the chmod command? What does ‘ch’ represent?

Answer: ch represents ‘change.’ chmod changes the access permissions for a file. We can represent permissions in octal digits 0-7 or letters. Example:

chmod 777 test.txt will give read, write, and execute permission for the file test.

chmod rwx test.txt does the same using letters.

22. What are the network commands you have used in Unix?

Answer: Some popular network commands are:

23. Differentiate between the absolute and relative path.

Answer: The absolute path is the complete path of a file or directory starting from its root directory. For example, /users/local/system

A relative path is the path from the current user directory and is not the complete path. It is the present working directory (PWD).

24. Explain pid with an example.

Answer: PID denotes process id. It is a unique id (number) that identifies all the processes running on the Unix system, whether foreground or background.

25. Describe inode.

Answer: The inode contains all the information about a file. It is a data structure that includes the file location on the disk, mode information, file size, device id, group id, access privileges, timestamps for file creation and modification, file protection flags.

26. If you have to change a Unix Directory, which command will you use?

Answer: The command chdir is used to change the Unix directory.

27. What are the uses of ‘mv’ and ‘cp’ commands?

Answer: cp copies files to a new directory location. The simple syntax is:

cp <source> <destination>. After executing the command, both the locations will have the same file.

mv is used to move/rename a file to another location (directory). The syntax is the same as cp:

mv <source> <destination>

The file will not be available in the source unless you specify backup options.

28. What are symbolic links?

Answer: A symbolic link has references to another directory or file. References are either relative (reference) or absolute (complete). The OS interprets symbolic links. The other file/directory is known as ‘target’. The symbolic link is created as:

ln –s <target> <link_name>

29. What are the permissions that can be given for a file? How can we change the permissions?

Answer: Unix files have three permission levels: write, execute and read. These are arranged in the order as <user permission>-<group permission>-<other permission>.

See Q21 use the chmod command.

30. Write the command to find the process that’s taking a lot of memory and kill that process.

Answer: The top command displays the pid, CPU usage, and other process details taking the maximum memory.

You can kill such a process using the kill command by passing the pid: kill <pid>

31. Do you know how to make changes to a large file without opening it?

Answer: For this, the sed command is used. For example, we want to replace the word ‘John’ with ‘Sam’. We can give the command as:

sed ‘s/John/Sam’ myfile.txt

32. What are the privileges of a superuser?

Answer: Superusers can access all the files and commands on the system without restriction. You can think of it as an admin account, which is above all the other accounts.

33. Can you list out a few shell responsibilities?

Answer: A shell is responsible for the following:

  • Environment control
  • I/O redirection
  • Program execution
  • Pipeline hookup
  • File name/variable substitution

34. How do you view information about a process in Unix?

Answer: You can just type ‘ps’ command.

35. Do you know about parsing? What is it?

Answer: The breaking of a command line into words by using spaces and delimiters is called parsing.

36. I want to search for the word ‘Morning’ in a file ignoring the case (example, considering both ‘m’ and ‘M’). For example, ‘morning’, ‘mORning’, ‘Morning’ etc. How can I do that?

Answer: Yes, by using the following command.

grep -vi morning myfile.txt

37. Explain what this command will do: sort file.txt | uniq > file2.txt

Answer: The command will sort the contents of the file and put the unique content into file2. Duplicate entries will not be copied to file2.

38. How do you get user inputs in Unix? Give an example.

Answer: Suppose we want to get a user’s name:

echo Hi, What is your name\?

echo Welcome, $name

39. How do you get the current date? Can you customize how the date is printed?

Answer: We can get the current date by typing the ‘date’ command. Suppose we want the format as: day, month, date, year, time; we will specify the sequence as:

echo $5 $3 $1 $2 $6 $4

40. What is a zombie process?

Answer: These are processes that do not take up any physical memory. Zombie processes have one or more of their listings still in the process table even after completion of execution.

41. What is swapping? Explain how a swapper works.

Answer: Swapping is a process where a complete process to be executed is moved to the main memory. The main memory capacity has to be more than the process size.

The swapper works based on a high scheduling priority base. It checks for sleeping processes. If there are not any, then ready-to-run processes are taken for swapping. To be swapped, the process should reside in the swapper for at least 2 seconds. If there are no available processes, the swapper goes into a wait state and waits until called by the Kernel (every second).

42. Explain what the ‘more’ command does.

Answer: It displays the contents of a file page by page instead of scrolling at once.

43. How can you check the disk capacity using the Unix command?

Answer: The disk capacity is checked using the ‘du’ command.

44. What is the fork() system call? How is it different from vfork() ?

Answer: The fork() call creates a child process from an existing (parent) process. In the process, the kernel places a copy of the parent process’s address space into the child process. vfork() call is faster as it does not do the above.

45. Can you explain the page fault and kinds of page faults?.

Answer: It is a situation when a process tries to refer to a page. But the page is not there in the main memory. The two types are validity fault (whether the page is valid or not) and protection fault (whether it can be accessed).

46. Can you write a command to instruct the Unix system to restart after 30 minutes?

Answer: /sbin/shutdown -r+30. Here 30 indicates the minutes.

47. How does Unix represent hidden files?

Answer: Hidden files are represented using ‘.’ or dot before the file name. For example, .cshrc, .profile etc.

48. What is meant by the command: cd ../..

Answer: It means to change the directory to two directories back. For example, if you are on /usr/bin/sh, you will move to /usr.

49. Write the various commands to create new files in Unix?

Answer: We can do so using the command, $touch filename

We can also use the vi filename command.

50. Is there any difference between shell and environment variables? If yes, please tell me what it is.

Answer: Environment variables are global variables available to a program and its children. Shell variables are available only in the current shell. Once you exit the shell, the variables are lost.

One of the key points to clear an interview is to be confident and accept what you don’t know. Interviewers don’t want you to know everything or be perfect. Just don’t beat around the bush and explain what you know thoroughly. Learn more about Unix through our list of courses and tutorials . Happy preparing!

People are also reading:

  • Basic Linux Commands
  • Difference between Linux vs Windows
  • Top Linux Interview Questions
  • Linux Cheat Sheet
  • Top 10 Open Source Security Testing Tools
  • Top Docker Interview Questions
  • Top AWS Interview Questions
  • Top Jenkins Interview Questions
  • Download SQL Cheat Sheet
  • Java Cheat Sheet
  • Git Cheat Sheet

Subscribe to our newsletter

Welcome to the club and Thank you for subscribing!

unix assignment questions with answers

A cheerful, full of life and vibrant person, I hold a lot of dreams that I want to fulfill on my own. My passion for writing started with small diary entries and travel blogs, after which I have moved on to writing well-researched technical content. I find it fascinating to blend thoughts and research and shape them into something beautiful through my writing.

Disclosure: Hackr.io is supported by its audience. When you purchase through links on our site, we may earn an affiliate commission.

In this article

  • Top 90 Shell Scripting Interview Questions and Answers in 2024 Career Development Interview Questions Operating Systems Linux Command Line (CLI)
  • Best Linux Distro for Programming: Top 6 Ranked [2024] Operating Systems Linux
  • Unix vs Linux: What is the Difference? Operating Systems Linux Unix

Please login to leave comments

Always be in the loop.

Get news once a week, and don't worry — no spam.

  • Help center
  • We ❤️ Feedback
  • Advertise / Partner
  • Write for us
  • Privacy Policy
  • Cookie Policy
  • Change Privacy Settings
  • Disclosure Policy
  • Terms and Conditions
  • Refund Policy

Disclosure: This page may contain affliate links, meaning when you click the links and make a purchase, we receive a commission.

Download the Unstop app now!

Check out the latest opportunities just for you!

100 Of The Most Asked UNIX Interview Questions And Answers

Srishti Magan

Table of content: 

Basic unix interview questions and answers, intermediate unix interview questions and answers, advanced unix interview questions and answers.

UNIX is a computer operating system that was initially developed in 1969 and has been continuously updated since then. It's a multi-user, multi-tasking system that's suitable for servers, desktops, and laptops. UNIX systems include a graphical user interface (GUI) comparable to Microsoft Windows that makes it simple to use.

However, knowledge of UNIX is essential for activities that are not covered by graphical software or when a Windows interface is not accessible, such as in a telnet session. On the market, there are several Unix variations. A few examples are Solaris Unix, AIX, HP Unix, and BSD. Linux is a free version of Unix.

If you are planning to sit for a UNIX interview, you must have a thorough knowledge of the entire concept as your interviewer will test your technical expertise. We have created a list of handpicked UNIX interview questions and answers that will increase your chances of getting hired by your dream company.

Output Devices Of Computer | Types, Functions & Applications

1. What do you mean by UNIX?

It's a lightweight operating system that's optimized for multitasking and multi-user functionality. Because of its mobility, it can operate on a variety of hardware systems. It was created in C and allows users to manipulate and process data from within a shell.

2. Explain kernel. 

The kernel is the main software that manages the computer's resources. This component is in charge of allocating resources to various users and tasks. When a user logs in to the system, the kernel does not interface directly with the user; instead, it launches a separate interactive program termed shell for each user.

3. What is the definition of a single-user system?

Single-user systems have an operating system that can only serve one user at a time. A single-user system is a computer with an operating system that can only be used by one person at a time. Because of the low cost of hardware and the availability of a large selection of software to accomplish various functions, single user systems are becoming increasingly popular.

4. What do you mean by shell?

A shell is software that allows you to access the Unix operating system. It gathers information from you and executes programs based on that information. Once a program has completed its execution, the output is shown. Shell is a command-line interface that lets us run commands, programs, and shell scripts from the command line. Shells are available in a range of flavors, similar to how operating systems are available in a variety of flavors. Common shells have a collection of well-known commands and features.

5. What are a shell’s responsibilities?

A shell's responsibilities are as follows:

  • Execution of the Program
  • Redirection of input and output
  • Variable substitution and filename
  • Connection to a pipeline
  • Controlling the environment
  • Integrated programming language

6. When sending commands in the shell, what is the common syntax used?

The following is a typical command syntax in the UNIX shell:

Command [-argument] [-argument] [–argument] [file]

7. Describe a UNIX link.

The term " link " is used to refer to a file that has more than one name. It's similar to a file pointer, except that one file might have several pointers. There are two sorts of links: internal and external.

Hard link - These hard-linked files have the same node value as the original and hence relate to the same physical file location. The link will also function if the file is relocated to a different directory.

ln [name of the original file] [name of the link]

Soft link - A soft link is similar to a file shortcut, except it has a different node than the original. If the original file is relocated, the link may not operate, but it can still refer to other files.

ln -s [original filename] [link name]

8. What does the term directory mean in UNIX?

A directory is a particular type of file that keeps track of all the files it contains. A directory is allotted to each file. Both ordinary and special files and folders are stored in this file type. 

9. What are the shell types in UNIX?

Shells are divided into two categories in Unix:

  • Bourne Shell - The $ character is the default prompt if you're using a Bourne shell.
  • C-Shell - If you're using a C-shell, the % character serves as the default prompt.

10. Describe the Bourne Shell and C-Shell categories.

The Bourne Shell and C Shell (csh) are two of the most well-known Unix shells, each with its own set of categories for Unix commands and utilities. These categories aid in the organization and classification of the numerous commands and programs accessible in the Unix ecosystem.

The different subcategories are:

  • Bourne shell (sh)
  • Korn shell (ksh)
  • Bourne Again shell (bash)
  • POSIX shell (sh)
  • C shell (csh)
  • TENEX/TOPS C shell (tcsh)

11. Explain the fork() system call.

The command fork used to generate a new process from an existing one is called fork(). The parent process is the primary process, while the child process is the new process id. The child process id is given to the parent process, while the child is given 0. The values returned are used to verify the process and the code that was performed.

The fork() system call takes no arguments and returns an integer. 0 signifies that the child process is created successfully, and it refers to the child process within the parent process.–1 means that the system failed to create another process.

12. What is command substitution and how does it work?

Every time instructions are handled by the shell, one of the steps is command substitution. Only instructions placed in backquotes are executed by the shell. This will then take the place of the command's usual output and be shown on the command line.

13. What do the commands chmod, chown, and chgrp do?

These are commands for managing files. These are utilized for the following purposes:

chmod - This command modifies a file's permissions.

$ chmod g+w textfile

chown - This command changes the file's ownership.

$ chown scoy3421 textfile

It makes scoy3421 the owner of textfile.

chgrp - The group of the file is changed using this command.

$ chgrp moderators textfile

It elevates a set of text files to the status of moderators.

14. What precisely is a daemon?

A daemon is a job or process that runs in the background and is responsible for a certain task or group of activities. This is a key idea in the Unix operating system. Memory management, file system administration, printer jobs, network connections, and a variety of other services are all handled by the Unix kernel's system daemons.

15. What is the Unix process model?

A priority-based preemptive round-robin scheduling technique is used to schedule processes. There will be no CPU starvation or saturation as a result of this. Processes can be preempted from the run queue and shifted to the sleep queue based on the completion of the time slice or wait by any I/O. Because we may encounter stalemate on any resource when scheduling, user applications must offer deadlock detection to guarantee that user processes do not become stuck.

16. What is the procedure for modifying file access permissions?

When adding or updating file access permissions, there are three sections to consider:

  • File owner’s user ID
  • File owner’s group ID
  • File access mode to define

The following is how these three pieces are organized:

(User permission) – (Group permission) – (other permission)

There are three forms of authorization:

  • r - denotes permission to read.
  • w - denotes permission to write.
  • x - denotes permission to execute.

17. How much do you know about shell variables?

The shell features a few preset internal variables, as well as the ability to create new ones. Some of them are variables that affect the environment, while others affect the local environment. These can be accessed through a variety of methods. A variable's name can only contain letters (A-z), digits (0-9), or the underscore character (_).

NAME="Sachin Tendulkar" $ echo $NAME $ unset NAME

18. Compile a list of regularly used network commands in UNIX.

The following are some of the most widely used networking commands in Unix:

  • telnet: This is used to log in from a remote location and communicate with another hostname.
  • ping : This command is used to test the network connectivity.
  • hostname : This contains the IP address as well as the domain name.
  • nslookup : Performs a DNS lookup.
  • xtraceroute : This is used to figure out how many hops and how long it takes to go to the network host.
  • netstat : This command displays information about the system and ports, as well as routing tables and interface statistics.
  • tcpdump : This command displays information on both incoming and outgoing network traffic.

19. What is an inode?

An inode is a file system entry that is generated on a part of the disc dedicated to the file system. The inode stores almost all of a file's information. It contains information such as the file's initial position on the disc, its size, when it was last used, when it was last altered, the file's read, write, and execute rights, who owns the file, and other details.

20. Explain the many types of pathnames and how to create them in UNIX.

A path is the unique location of a file or directory, as well as a mechanism to access it inside a directory hierarchy. In Unix, pathnames are divided into two categories:

  • Absolute Pathname: The whole path from the beginning of the file system to the location of a file or directory (root directory). /usr/local/Cellar/mysql/bin is an example.
  • Relative Pathname: This is the path from the user's current working directory, i.e. the current working directory (pwd). The relative path for the bin is ./mysql/bin if the current directory is /usr/local/Cellar .

21. Describe the functionality of the 'find' command in UNIX.

The 'find' command is used to search for files and directories within a specified directory hierarchy. It is often used with various options to locate and perform actions on files that match specific criteria.

22. How do you determine the process ID (PID) of a running process in UNIX?

You can use the 'ps' command to list running processes and their PIDs. For example: ps aux | grep processname .

23. What does the UNIX architecture look like?

The Unix architecture consists of the following main components:

Hardware Layer: The physical computer components.

Kernel: The core of the operating system, managing processes, memory, and devices.

Shell: The user interface for interacting with Unix, often through a command-line interface.

These components work together to enable the Unix operating system to function.

24. Explain the role of the 'history' command in UNIX.

The 'history' command displays a list of previously executed commands, allowing users to recall and re-run commands from their command history.

25. In which year was UNIX founded?

UNIX was founded in the year 1969 by Ken Thompson and Dennis Ritchie.

Generations Of Computer | 1st, 2nd, 3rd, 4th & 5th Generations

26. In UNIX, explain Superblock.

A SuperBlock is software that stores information on a certain file system, such as the block size, the number of vacant and full blocks, the size of block groups, the disc block map, the size and placement of inode tables, and use statistics.

Superblocks are divided into two categories:

  • Default Superblock: The default superblock is a predetermined offset from the system's disc partition's start.
  • Redundant Superblock: Multiple copies of a default superblock exist and are accessed when the default superblock is impacted by a system crash or problems.

27. Enlist some of the certain UNIX file manipulation commands.

Here are a few commands for manipulating files:

  • cat filename - This shows the contents of the specified file.
  • cp source destination - This command copies the source file to the destination folder.
  • mv old_name new_name - Rename/move files.
  • rm filename - Deletes/removes a file.
  • touch filename - time of creation/modification.
  • In [-s] old_name new_name - Generating a soft link on an old name.
  • Is –F - Shows details about the file type.
  • ls -ltr - This displays the list in long format, arranged by modification time from oldest to newest.

28. In terms of Unix commands, what are system calls and library functions?

  • System calls : System calls are an interface to the kernel that allows user applications to ask the operating system to do activities on their behalf. The application software switches from user space to kernel space whenever a system call is made within the operating system. These aren't easily transportable.
  • Library functions: Library functions are non-kernel functions that are utilized by various application programs. It takes less time to execute than a system call, is portable, and can only conduct specified activities in “ kernel mode” .

29. What is meant by virtual memory?

Virtual Memory is a method or system for accessing more memory than is physically available. The model is made up of a series of memory pages, each of which is typically 4 KB in size. Between virtual memory addresses and physical memory addresses, there is a translation layer. This translation layer is part of the kernel, and it's commonly written in machine language (Assembly) to get the best results when translating and mapping addresses. The kernel employs the address translation layer to transform the virtual memory address into a physical memory address whenever a user process accesses memory. Virtual Addressing allows you to address more memory than is physically available.

30. Distinguish between a relative and an absolute path.

The path relative to the present path is referred to as a relative path. On the other hand, an absolute path refers to the exact path as referenced from the root directory (the first directory is called the root directory).

31. What's the difference between a UNIX command, a library function, and a system call?

A system call is an element of the kernel's programming. A library function is a program that isn't part of the kernel but is accessible to system users. UNIX commands , on the other hand, are standalone programs that can include both system calls and library functions.

32. What does the kill() system call do and what do the return values mean?

The kill() system function delivers signals to any running process, which then takes appropriate action in response to the signal. It accepts two arguments: the first is the PID of the device to which you want to send a signal, and the second is the signal you wish to send.

The following values are returned by this method:

  • 0 - indicates that the process with the supplied PID exists and that the system enables signals to be sent to it.
  • -1 and errno==ESRCH - indicates that the process/process group given by the PID does not exist.
  • 1 and errno==EPERM - The sender does not have the authorization to transmit a signal to the destination process.
  • EINVAL - indicates that an invalid signal has been supplied.

33. What exactly is UNIX's Zombie process? How is the Zombie procedure found by you?

Child processes that finish before the parent process is known as zombie processes. So, once the process is over, the process structure and address space are withdrawn from the system and freed up, but the process table entry remains. In the process table, one can easily locate the process ID of the same despite it remaining non-functional. The parent must call and wait, in order to obtain the status of the child's procedure (). The kid is considered to be a 'zombie' during the time between the child's termination and the parent's call to wait().

34. Explain how to boot a UNIX system.

There are five phases to it:

  • Hardware - BIOS starts up and scans for a hardware connection.
  • Operating System loader - The OS loader is found in the MBR, which is the first 512-byte block of the boot device.
  • Kernel - It initializes different components of the computer, operating system, and each section of software responsible for a job, which is commonly considered a driver root user.
  • root user-space process (init and inittab) - This specifies what should be done when the /sbin/init program is told to enter a certain run-level, making it simple for the administrator to set up a specific environment.
  • Boot scripts - There is a single startup script for each managed service (mail, nfs server, cron, and so on) located in a specific directory.

35. Distinguish between the cmp and diff commands.

The cmp command is primarily used to compare two files byte by byte, with the first mismatch shown. The diff command, on the other hand, is used to identify the changes that need to be done to make the two files identical.

36. State the differences between Linux and Unix.

Differences between Linux and Unix are:

37. What are the I/O calls in the Unix System?

A system call is a method for applications to communicate with the operating system. For file management, process control, device administration, information management, and communication, Unix System calls are utilized.

The following are some of the most regularly used I/O System calls:

  • open(pathname, flag, mode) - a command that opens a file.
  • close(filedes) - closes a file that is currently open.
  • create(pathname, mode) is a command that creates a file.
  • write(filedes,buffer,bytes) - writes data to a currently open file.
  • read(filedes, buffer, bytes) - read data from a file that is currently open.
  • lseek(filedes, offset, from) - position an open file using.
  • dup(filedes) - duplicates a file descriptor that already exists.
  • dup2(oldfd, newfd) - replace the old file descriptor with the appropriate file descriptor.
  • ioctl(filedes, request, arg) - Change the behavior of an open file.
  • fcntl(filedes,cmd,arg) - Change the attributes of an open file.

38. In Unix, what exactly is a process?

A process is a set of instructions or a specific instance of a program that is running. Any application that is run generates a process. Processes can be manipulated in the same way that files may. Various qualities are connected with a process:

  • PID stands for Process-ID.
  • PPID stands for Parent Process ID.
  • TTY (Teletypewriter) is the terminal with which the process is attached.
  • UID refers to User Identification.

39. What method do you use to obtain the current date? Is it possible to change the way the date is printed?

The current date may be obtained by entering the 'date' command. If we want the format to be the day, month, date, year, and time, we'll use the following sequence:

set ‘date’ echo $4 $2 $5 $2 $6 $4

40. For Demand paging, what data structures are used?

In operating systems, demand paging is a memory management strategy used to optimize memory utilization and system performance. It enables programs to load data into memory only when needed rather than putting the complete program into memory all at once. This reduces memory waste and boosts overall system responsiveness.

Several data structures are used in demand paging to control the movement of pages between main memory (RAM) and secondary storage (often a hard disc). These data structures are:

  • Page Table: Maps virtual memory addresses to physical memory locations.
  • Page Table Entry (PTE): Contains information about each page, including its state and location.
  • Page Frame Data Table: Tracks the state of page frames in physical memory.
  • Backing Store or Swap Space: Secondary storage where pages are stored when not in memory.
  • Swap Use Table: Monitors the usage of swap space to manage allocation and deallocation.

41. State the difference between shell & environment variables.

Environment variables are accessible to all processes in the current session and are often used for system-wide configuration. Shell variables are specific to the current shell session. The variables are lost when you quit the shell.

They are different in terms of scope and accessibility. Here are other differences between the two: 

42. What exactly is swapping? Describe how a swapper operates.

Swapping is the process of moving a full process to the main memory to be performed. The capacity of the main memory must be more than the process size.

The swapper operates on a high-priority scheduling system. It looks for processes that are sleeping. If none are available, ready-to-run processes are used instead. To be swapped, the process must spend at least 2 seconds in the swapper. If no processes are available, the swapper enters a wait state and waits for the Kernel to call it (every second).

43. In UNIX, what are hidden files?

In UNIX, hidden files are those with a. (dot) before the file name. The standard file manager does not recognize these files.

The following are some instances of hidden files:

44. How to log out of UNIX?

To log out of UNIX type the logout command in the command prompt. Here's the command:

45. How would you reverse a string in UNIX?

To reverse a string in Unix we use the rev command.

$> echo "String" | rev gnirtS

46. How do you define an array in UNIX Shell?

Following is the way to create an array in Shell:

NAME1="Vuitton" NAME2="Chanel" NAME3="Gucci" NAME4="Prada" NAME5="AlexanderMcQueen"

Declaring an array variable in Unix is as follows:

array_name[index]=value

The name of the array is array_name , the index of the item in the array that you want to set is the index , and the value is the value you want to set for that item is value.

47. How do you set up an environment in UNIX?

The shell goes through an initialization process when you log in to the system to set up the environment. This is normally a two-step procedure that begins with the shell reading the files listed below:

  • /etc/profile

The steps are as follows:

The shell checks for the existence of the file /etc/profile.

The shell reads it if it exists. If not, this file will be skipped. There is no error message displayed.

The shell looks in your home directory to determine if the file .profile exists. Your home directory is the first directory you see when you log in.

The shell reads it if it exists; else, it skips it. There is no error message displayed.

When both of these files have been read, the shell shows a prompt: $

When this command shows, you can enter commands.

48. How can you send an email using UNIX?

An email can be sent using the following commands using the UNIX shell.

$mail [-s subject] [-c cc-addr] [-b bcc-addr] to-addr

49. Define piping in Unix.

You can chain two instructions together such that one program's output becomes the input for the next. A pipe is formed when two or more instructions are joined in this manner. To build a pipe, place a vertical bar (|) between two instructions on the command line.

50. What precisely are foreground and background processes in Unix?

Foreground Process:

Every one of the processes you launch by default runs in the forefront. It takes input from the keyboard and displays the results on the screen.

With the ls command, you can observe what's going on. You may use the following command to get a list of all the files in your current directory:

$ls ch*.doc

You can also use ls-lrta command to display hidden files in the current directory.

The process runs in the foreground, the output is sent to my screen, and the ls command waits for input from the keyboard if it needs it (which it doesn't).

Because the prompt will not be available until the program finishes processing and exits, no other commands can be performed (no other processes can be started) while it is running in the foreground.

Background Process:

Without being linked to your keyboard, a background process operates. It waits for any keyboard input if the background operation demands it.

You may run additional commands while a process is running in the background; you don't have to wait for it to finish before starting another!

Adding an ampersand (&) to the end of a command is the easiest method to start a background process.

$ls ch*.doc &

51. What is the definition of a shebang line?

In Unix-like operating systems, a shebang line, sometimes known as a "hashbang" or "pound-bang" line, is a specific comment at the beginning of a script or executable file. It is composed of the characters #! followed by the path to the interpreter to be used to execute the script or program.

For example, in a Python script, the shebang line might look like this:

#!/usr/bin/python3

52. What is the function of the telnet command?

The telnet command is used to establish a connection with a distant Unix/Linux computer.

53. What is the function of the book block?

It includes software called MBR (Master boot record) that loads the kernel on system booting.

54. Explain the significance of the '/etc/passwd' file in UNIX.

The '/etc/passwd' file stores user account information, including usernames, user IDs, group IDs, home directories, and shell information. It is essential for user authentication and system administration.

55. How do you change the ownership of a file in UNIX using the 'chown' command?

You can change the ownership of a file with the 'chown' command by specifying the new owner and, optionally, the new group.

For example: chown newuser:newgroup filename.

56. What is the 'ulimit' command in UNIX used for?

The 'ulimit' command is used to set or display user-level resource limits in UNIX. It allows controlling resource consumption, such as maximum file size, CPU time, and open file descriptors.

57. What is the 'umask' command in UNIX, and how is it used to set file permissions?

'umask' sets the default file permissions for newly created files. It subtracts the specified permission bits from the maximum permission value (usually 666 for files and 777 for directories) to determine the default permissions.

58. Explain the purpose of the 'script' command in UNIX.

The 'script' command is used to record the input and output of a terminal session into a file. It is often used for creating session logs and documenting terminal interactions.

59. Show how to create functions on Unix with an example.

Simply use the following syntax to declare a function:

func_name () { list of commands }

Your function's name is func_name, and you'll refer to it by that name throughout your scripts. After the function name, there must be a parenthesis, then a list of commands contained in braces.

For example:

#!/bin/sh # Define your function here Hello () { echo "Hello World from my Unix" } # Invoke your function

You will get the following output after running the command:

$ksh main.ksh Hello World from my Unix

60. What is the use of the tee command?

The tee command helps in two things. Firstly, it is used to get data from the standard input and send it to the standard output. Secondly, it redirects a copy of that input data into a file that was specified.

61. What is the 'nohup'?

"nohup" is a special command to run a process in the background even when a user logs off from the system.

62. What is the 'gzip' command used for?

The gzip command in Unix is used to compress files, reducing their size.

The basic usage is: gzip file

63. What are Symbolic links?

They are files that only contain the name of another file. The operations on the symbolic link get directed to the file pointed by it. The limitations of connections are eliminated in symbolic links.

64. How many types of job classes are provided by UNIX? Explain them all.

Unix-like operating systems do not have predefined "job classes." Instead, they offer mechanisms like foreground and background jobs, process states, job control, process priorities, and shell scripting, allowing users to manage and categorize tasks and processes based on their specific requirements and characteristics. Users have the flexibility to use these mechanisms to organize and control their jobs and processes effectively.

65. How do you delete a file?

To delete a file, you can use an 'rm command'. The syntax for the rm command is:

$ rm <filename>

You can also use -r with the rm command to delete all the sub-directories recursively.

66. What is a wild-card interpretation?

When a command line contains a wild-card character(s) such as ‘*’ or ‘?’, they are replaced by the shell with a sorted list of files whose patterns match the input command. Wild-card characters are used to set up a list of files for processing, instead of having it specified one at a time.

67. Describe the main features of UNIX.

The main features of UNIX are listed below:

Portability: UNIX applications and scripts can be easily transferred between UNIX systems, ensuring seamless integration.

  • Machine Independence: UNIX is adaptable to different hardware types, ensuring flexibility and cross-platform compatibility.

Multi-User Support: UNIX facilitates concurrent use by multiple users, each with personalized settings and files.

Command Shells: UNIX provides a variety of command-line interfaces (shells) with scripting capabilities for user interactions.

Hierarchical File System: UNIX uses a tree-like structure for organizing files and directories, simplifying file management.

Pipes and Filters: UNIX allows the creation of efficient data processing pipelines through command chaining.

Background Processing: UNIX enables tasks to run in the background independently, freeing up the terminal for other activities.

Utilities: UNIX offers an extensive set of built-in tools and commands for tasks ranging from file management to system administration.

Development Tools: UNIX provides a comprehensive suite of development tools, including compilers, debuggers, and scripting languages, making it a preferred platform for software development.

68. What does Relative pathname signify?

Relative pathname signifies the current directory and parent directory. It also refers to files that are either inconvenient or impossible to access.

69. What's the purpose of the 'gunzip' command?

The gunzip command in Unix is used to decompress gzip-compressed files. It takes a compressed file (with a .gz extension) and restores it to its original, uncompressed state.

The basic usage is: gunzip file.gz

70. Which command is used to find the maximum memory-taking process on the server?

The top command is used to find the maximum memory-taking process on the server. It displays the CPU usage, process ID, and a few other details. The syntax for the command is sh-4.3$ top .

71. Why is it not advisable to use root as the default login?

One needs to keep in mind the concept of Privilege escalation. If any security vulnerability is exploited (for instance, your web browser), not running your programs as root will limit the damage. If your web browser is running as root, any security failures will have access to your entire system.

72. Explain the difference between a process and a thread in Unix.

In a nutshell:

  • Process : Independent program with its own memory and resources.
  • Thread : Lightweight unit within a process that shares the same memory and resources with other threads in that process.

73. What is the difference between swapping and paging?

74. what is fifo.

In Unix, FIFO stands for "First-In, First-Out." It's a named pipe that allows processes to communicate by reading and writing to a shared file-like resource in the sequence in which they were received. It is a unique file format that allows data to be shared between processes in the order it was written. If there is no data to read or the FIFO is full, the process will be blocked. Though it's a special file, it has the same permissions and ownership as ordinary files and is widely used for process communication.

75. What is the purpose of the 'cron' utility in UNIX?

The 'cron' utility is used for job scheduling and automation in UNIX. It allows users to schedule tasks and scripts to run at specified times or intervals.

76. Explain the concept of a Super User.

In Unix, the Super User, also known as "root," is the user with the most privileges who is in charge of important system administrative responsibilities. The root user has the ability to perform any operation on the system, but this power comes with the requirement to exercise prudence in order to avoid security concerns and system instability. To safeguard the root account and the broader system, security techniques such as restricted access and "sudo" are in place.

77. How can you create a symbolic link (symlink) in UNIX?

To create a symbolic link, you can use the 'ln' command with the '-s' option.

For example: ln -s sourcefile linkname.

This creates a symlink named 'linkname' that points to 'sourcefile.'

78. What is the purpose of the 'chroot' command in UNIX?

The 'chroot' command is used to change the root directory for a process, limiting the access of that process to a specific directory and its subdirectories. It is often used for security and isolation purposes.

79. Describe the role of the 'at' and 'batch' commands in UNIX.

The 'at' and 'batch' commands are used to schedule one-time tasks in UNIX. 'at' allows you to schedule a command to run at a specific time, while 'batch' schedules a task to run when the system load is low.

80. What are hard links and how do they differ from symbolic links?

Hard links are multiple directory entries (filenames) that point to the same inode, representing the same file on disk. They essentially create multiple directory entries for a single file. In contrast, symbolic links (symlinks) are separate files that point to another file or directory by its path. Hard links can only point to files on the same filesystem, while symlinks can point to files on different filesystems.

81. How do you change the permissions of a file in UNIX?

You can change file permissions with the 'chmod' command by specifying the desired permissions using symbolic or octal notation. For example, to give read and write permissions to the owner of a file: chmod u+rw filename . Octal notation can be used as well, like: chmod 644 filename for the same permissions.

82. What is the purpose of the 'grep' command in UNIX?

The 'grep' command is used for searching and matching patterns within text files. It is particularly useful for extracting lines or data that match specific criteria using regular expressions.

83. What's the default network stacking protocol for UNIX?

The Internet Protocol (IP) is often the default network stacking protocol in Unix-like operating systems. IP is a basic protocol that allows data to be sent over networks such as the Internet. It implements the addressing and routing mechanisms required for data packets to reach their destinations. Unix systems, such as Linux, rely significantly on IP for network communication. While IP is the most often used network protocol, Unix systems also offer a variety of other network protocols and services to meet a variety of networking requirements.

84. How do you archive and compress files in UNIX using the 'tar' and 'gzip' commands?

To archive files using 'tar': tar -cvf archive.tar files . To compress the archive using 'gzip': gzip archive.tar . To extract: tar -xvf archive.tar.gz .

85. What is the purpose of the 'awk' command in UNIX?

 'awk' is a versatile text processing tool used for data manipulation, reporting, and extraction. It allows users to define patterns and actions to process structured data.

86. How do you set environment variables in UNIX, and what is their significance?

Environment variables are set using the 'export' command.

For example: export MY_VARIABLE=myvalue. 

Environment variables store configuration information and are accessible to all processes in the current session.

87. How do you send signals to processes in UNIX using the 'kill' command?

The 'kill' command is used to send signals to processes. For example, to terminate a process, you can use kill <PID> or kill -9 <PID> to forcefully terminate it.

88. What is the purpose of the 'ifconfig' command in UNIX?

'ifconfig' is used to configure and display network interfaces, including assigning IP addresses, enabling or disabling network interfaces, and obtaining network-related information.

89. What is the alias mechanism? 

The alias mechanism in Unix allows users to create custom shortcuts for frequently used or lengthy commands. The alias command is used to define these shortcuts. For example, you can create an alias like ll for ls -l , making it easier to run commonly used commands.

90. Explain the purpose of the 'ssh' command in UNIX.

The 'ssh' command is used to securely connect to remote systems over a network. It provides encrypted communication and authentication for secure access to remote servers.

91. How do you archive and compress files in UNIX using the 'zip' command?

To create a zip archive: zip archive.zip files .

To extract: unzip archive.zip .

92. What is the purpose of the 'tee' command in UNIX?

The 'tee' command is used to read from standard input and write to standard output and files simultaneously. It is often used to capture and view output while saving it to a file.

93. How can you check available disk space in UNIX using the 'df' command?

The 'df' command is used to display information about available disk space on filesystems. Running 'df' without options will list space usage on all mounted filesystems.

94. How can you view and manipulate the process table in UNIX using the 'ps' command?

The 'ps' command is used to list and manage running processes. You can display a list of processes using various options like 'ps aux,' and use options like 'kill' or 'nice' to manage processes.

95. What is the purpose of the 'lsof' command in UNIX?

The 'lsof' (list open files) command is used to display information about files and network connections opened by processes. It is useful for troubleshooting and identifying which processes have specific files or sockets open.

96. Explain the concept of 'stdin,' 'stdout,' and 'stderr' in UNIX.

'stdin' (standard input), 'stdout' (standard output), and 'stderr' (standard error) are the default data streams for processes. 'stdin' is where a process reads input, 'stdout' is where it writes normal output, and 'stderr' is where it writes error messages.

97. What is the 'chmod' command?

The chmod command in Unix is used to change file and directory permissions. It can be used to grant or restrict read, write, and execute permissions to users, groups, and others.

Basic usage: chmod [options] mode file

98. What is the CAT command?

The cat command in Unix is used to display the file contents. It's short for "concatenate" and is often used to view the contents of a single file. 

For example: cat filename

99. What is the tar command?

The tar command in Unix is used to archive and compress files and directories into a single file. It stands for "tape archive" and is often used for creating backups or bundling multiple files together.

Basic usage:

tar [options] archive_file files/directories

100. What's the role of mount and unmount commands?

The "mount" command attaches file systems to the operating system, making them accessible, while the "umount" (or "unmount") command detaches or unmounts them, ensuring data integrity and safe removal.

Summing up...

Unix specialists are in high demand in the software technology area. Unix allows you to advance in your career by allowing you to pick from a range of job titles such as Unix Engineer, Administrator, Systems Engineer, and Analyst Engineer.

Make sure you practice these interview questions and answers so you're able to showcase your knowledge.

You might also be interested in reading:

  • Difference Between Retesting And Regression Testing Explained (With Examples)
  • Difference Between Scripting And Programming Language | Why Scripting Language Is Considered A Programming Language But Not Vice-Versa?
  • Top 50+ Java Collections Interview Questions
  • What Is Scalability Testing? How Do You Test Application Scalability?

Srishti Magan

I’m a reader first and a writer second, constantly diving into the world of content. If I’m not writing or reading, I like watching movies and dreaming of a life by the beach.

Unstop Talent Park

to our newsletter

Blogs you need to hog!

Best Data Visualization Tools In 2024: A Complete Guide To The Top 10 Tools

Best Data Visualization Tools In 2024: A Complete Guide To The Top 10 Tools

unix assignment questions with answers

Characteristics Of IoT: Definition, Uses & Key Features Explained

Classification Of Embedded Systems In 5 Ways (With Applications)

Classification Of Embedded Systems In 5 Ways (With Applications)

unix assignment questions with answers

Find In Strings C++ | Examples To Find Substrings, Character & More!

unix assignment questions with answers

Top 75+ Unix Interview Questions and Answers you need to know in 2024

Unix has started to expand its market rapidly since the past few years and is one of the Top 10 occurring IT job-requirements. So, we thought of making your job easier by making an ensemble of the most commonly asked Unix Interview Questions which will get you ready for any job interview that you wish to appear. 

The following are the UNIX Interview Questions listed out for you;

Q1. Enlist common shells with their indicators. Q2. Define a single-user system. Q3. List a few significant features of UNIX? Q4. What is Shell? Q5. What are the basic responsibilities of a shell? Q6. What is the general format of UNIX command syntax? Q7. Describe the usage and functionality of the command rm –r *  in UNIX? Q8. Describe the term directory? Q9. Differentiate between absolute and related path? Q10. Which UNIX command lists files/folders in alphabetical order?

So, let’s begin.

Q1. Enlist common shells with their indicators.

The following table enlists the most common shells along with their indicators;

                                                Shell table – UNIX Interview Questions – Edureka

Q2. Define a single-user system. 

A personal computer which possesses an operating system designed to operate by only one user at a given time is known as a single-user system. Single user system becomes more popular since low-cost hardware and availability of a wide range of software to perform different tasks.

Q3. List a few significant features of UNIX?

The following are a few features of UNIX;

Machine independent

Portability

Multi-user operations

Unix Shells

Hierarchical file system

Pipes and filters

Background processors

Development tools

Q4.  What is Shell?

The program which serves as an interface between the user and the system called a shell. It  is the layer of programming that understands and executes the commands a user enters. In some systems, it’s also  called a command interpreter.

Q5. What are the basic responsibilities of a shell?

Following are the responsibilities of a shell;

Program Execution

Input/ output redirection

Filename and variable substitution  

Pipeline hookup

Environment control

Integrated programming language

Q6. What is the general format of UNIX command syntax?

Generally,   UNIX shell commands follow the following pattern

Command (-argument) (-argument) (-argument) (filename)

Q7. Describe the usage and functionality of the command rm –r *  in UNIX?

The command rm –r * erases all files in a directory with its subdirectories.

rm is for deleting files

-r is to delete directories and subdirectories with files within

* is indicate all entries

Q8. Describe the term directory? 

A directory in UNIX is a specialised form of a file that maintains a list of all the files which are included in it.

Q9. Differentiate between absolute and related path?

Absolute path refers to the exact path as defined from the root directory whereas, related path refers to the path related to the current locations.

Q10. Which UNIX command lists files/folders in alphabetical order?

The ls –l command is used to list down files and folders in alphabetical order, sorted with modified time.

Q11. Describe a link in UNIX.

Another name for a file is a link . It is used to assign more than just one name for a file and is not valid to assign more than one name to a directory or to link filenames on different computers.

General command ‘– ln filename1 filename2′

A symbolic link is a file that is used to contain only the name of other files included in it. Directed to the files pointed by it is the operation of the symbolic link.

General command ‘– ln -s filename1 filename2′

Q12. What is FIFO?

FIFO or First In First Out is also known as named pipes and it is a special file for date transient. This data is read-only in the written order and is used to inter-process communications. Here data writes at one end and reads from another end of the pipe.

Q13. What is the fork() system call?

The command used to create a new process from an existing process is called fork(). The main process is called the parent process and new process is called child process. The parent gets the child process is returned and the child gets 0. The returned values are used to check which process which code executed.

The returned values are used to check which process is executed.

Q14. Explain the following statement, “It is not advisable to use root as the default login.”

The given statement means the following;

The root account is very critical and can leads to system damage easily with abusive usage. The securities that normally apply to user accounts are not applicable to the root account. Hence, one should refrain from using root as the default login.

Q15. What is meant by the term Super User?

The Super User is a user with access to all files and commands within the system. In general, this superuser login is to root and the login is secured with the root password.

Q16. Define a process group.

A collection of one or more processes is called a process group. There is a unique process id for each process group. The function getpgrp returns the process group ID for the calling process.

Q17. Name the different file types available with UNIX.

Following the different file types in UNIX;

Regular files

Directory files

Character special files

Block special files

Symbolic links

Q18. What is the behavioural difference between cmp and diff  commands?

Despite the fact that both of these commands are meant for file comparison, there still remains a fundamental difference between the two.

Cmp compares the two given files, byte by byte and displays the first mismatch.

Diff displays the changes that need to be made in order to make both the files identical.

Q19. What do chmod, chown, chgrp commands do?

Following are the purposes of the given UNIX commands;

  • chmod changes the permission set of the file.
  • chown changes the ownership of the file.
  • chgrp changes the group of the file.

Q20. Give the command for finding the current date.

The command “date” is used to retrieve the current date.

Q21. What does this command do, "$more README.txt “?

The command displays the first part of the file names README.txt which just fit as much as on one screen.

Q22. Describe the zip/unzip command using gzip.

The gzip command creates a zip file using given the filename in the same directory.

gunzip command unzip the file.

Q23. Can you explain the method of changing file access permission?

There are three parts to consider when creating/changing file access permission.

File owner’s user ID

File owner’s group ID

File access mode to define

These three parts arrange as follows.

(User permission) – (Group permission) – (Other permission)

Three types of permission can define.

r –   Reading permission

w –   Writing permission

x –   Execution permission

Q24. How would you display the last line of a file?

The last line of a file is displayed using either “tail” or “sed” commands.

                                                   question 24 – UNIX Interview Questions – Edureka

In the example code above, the last line of the README.txt is displayed.

Q25. What are the various IDs in UNIX processes?

A process ID is a unique integer that UNIX uses to identify a certain process.

The process executes to initiate other processes is called parent process and its ID is defined as PPID (Parent Process ID).

  • getppid() retrieves the Parent Process ID

Every process is associated with a specific user and is called the owner of the process. The owner has all the privileges over the process. The owner is also the user who executes the process.

Identification for a user is User ID. The process also associated with Effective User ID which determines the access privileges to accessing resources like files.

getpid()   retrieves the Process ID

getuid() retrieves the User ID

geteuid() retrieves the Effective User ID

Q26. How can you kill a process in UNIX?

The Kill command accepts process ID (PID) as an in a parameter. This is applicable only for the processes owned by the command executor.

Syntax –   kill PID

Q27. What are the pros of executing processes in the background?

The main advantage is to execute processes in the background is to get the possibility to execute some other process without waiting for the previous process to get completed. The symbol “&” at the end of the process tells to the shell to execute given a command in the background.

Q28. What is the command to find maximum memory taking process on the server?

The top command displays the CPU usage, process id, and other details.

Output 

                                                   question 28 – UNIX Interview Questions – Edureka

Q29. What is the command to find hidden files in the current directory?

You use ls –lrta is to display hidden files in the current directory.

                                                   question 29 – UNIX Interview Questions – Edureka

Q30.  Which command can you use to find the currently running process in Unix Server?

ps –ef is a command used to find the current running process. Also, using grep with a pipe can find specific processes.

                                                   question 30 – UNIX Interview Questions – Edureka

Q31. Which command should you use to find the remaining disk space in UNIX server?

The command df -kl is used to get a detailed description of disk space usage.

                                                   question 31 – UNIX Interview Questions – Edureka

Q32. Which UNIX command to make a new directory?

The command mkdir directory_name is used to create a new directory.

Q33. What is the UNIX command to confirm a remote host is alive or not?

You can use either ping or telnet to confirm a remote host is alive or not.

Q34. How can you see the command line history?

The history command displays all the commands used previously in the current session.

                                                   question 34 – UNIX Interview Questions – Edureka

Q35. Differentiate between swapping and paging?

Swapping: In this, the complete process is moved to the main memory for execution. To provide the memory requirement, process size must be less than the available main memory capacity. The implementation is easy but is an overhead to the system. Memory handling is not more flexible with swapping systems.

Paging: In this, only the required memory pages are moved to the main memory for execution. The size of the process does not a matter of execution and it no needs to be less than available memory size. Allow a number of processes to load to main memory simultaneously.

Q36. Which command is used to find whether the system is 32 bit or 64 bit?

arch or uname -a can be used for the required process.

Q37. What is the ‘nohup’ in UNIX?

To run a process in the background,  nohup is a special command. The process started with this command does not terminate even if the user logs off from the system.

Q38. Name the UNIX command to find how many days the server has been up.

The uptime command returns the number of days that the server has been up.

                                                   question 38 – UNIX Interview Questions – Edureka

Q39. Which mode executes the fault handler?

The Kernel mode.

Q40. What does the “echo” command do?

The echo command outputs the strings it is being passed as arguments.

Q41. What is the explanation for protection fault?

When the process accesses a page which does not have access permission, it is referred to as protection fault. Also when a process attempts to write on a page whose copy on write bit was set during the fork() system call, it is incurred for protection fault.

Q42. How can you edit a large file without opening it in UNIX?

The  sed command can be used for this process. In the following example, the code replaces the a ‘s from the README.txt file to  aaa ‘s.

Example 

                                                   question 42 (I)- UNIX Interview Questions – Edureka

                                                   question 42 (II)- UNIX Interview Questions – Edureka

Q43. Describe the concept of “Region”.

A region is a continuous area of processes address space (text, data, and stack). Regions are shareable amongst the processes.

Q44. What is meant by u-area?

The area contains information specific to the process and is only manipulated by the kernel. It contains the private data unique to the process allocated to u-area.

Q45. Explain piping.

Piping(|) is used to combine two or more commands together where the output of the first command serves as the input of the second command, and so on.

Q46. How can you count the number of characters and lines in a file?

The wc – c filename command can retrieve the number of characters in a file and wc –l filename command can retrieve the number of lines in a file.

Q47. What do you understand by UNIX shell?

The UNIX shell serves as an environment to run commands, programs, and shell scripts. In addition to that, it also acts as an interface between the user and the Unix OS. Shell issues $  as the command prompt, which reads input and determines the command to execute.

For example: $date

The command above will display the current date and time.

Q48. Explain the term filter.

A Filter   is described as a program, which takes input from the standard input, and displays results to the standard output by performing some actions on it.

Standard Input could be typed on the keyboard, input from other file or output of other file serving as input. Standard output is default the display screen.

The most popular example of Unix filter id grep command. This program looks for a given pattern in a file or list of files and only those lines are displayed on the output screen which contains the given pattern.

Syntax:   $grep pattern file(s)

Q49. Can you write a command to erase all files in the current directory including all its sub-directories?

rm –r* is the command used to erase all files in the current directory including all its sub-directories.

rm: this command is used for deleting files.

-r : this option will erase all files in directories and sub-directories.

*: this represents all entries.

Q50. Can you explain what does the Kernel do?

The Kernel   is the heart of the operating system. It does not deal directly with the user but rather act as a separate interactive program for users logged in.

It is responsible for the following functions:

Interaction with the hardware

Memory management

File management

Task scheduling.

Computer resources

Allotment of resources to different tasks and users.

Q51. Name the key features of the Bourne shell.

The key features of the Bourne shell include but aren’t limited to the following:

Input/ Output redirection.

Use of Meta-characters for file name abbreviations.

Using shell variables for the customising environment.

Creation of programs using built-in the command set.

Q52. Name the key features of the Korn Shell.

The key features of the Korn shell include but aren’t limited to the following:

Perform command line editing.

Maintains command history so that the user can check the last command executed if required.

Additional flow control structures.

Debugging primitives who help programmers debug their code.

Support for arrays and arithmetic expressions.

Ability to use aliases which are defined as the shorthand names for command.

Q53. What can you tell about shell variables?

A variable is like a name. It is defined as a character string to which a value is assigned, where values could be the number, text, filename, etc. The shell maintains the set of internal variables as well as enables deletion, assignment, and the creation of variables.

Thus, a shell variable is a special variable that is set by the shell and is required by the shell in order to function correctly. Some of these variables are environment variables whereas others are local variables.

So, the shell variables are a combination of identifiers and assigned values that exist within the shell. These variables are local to the shell in which they are defined as well as they work in a particular way. They may have default value or values can be assigned manually by using appropriate assignment command.

To define a shell variable, the set command is used.

To delete a shell variable, the unset  command is used.

Q54. Describe the responsibilities of Shell in brief.

Although most commonly known for analysing the input line as well as initiating the execution of the program entered by the user, the Shell has various other responsibilities. A brief description of this is given to you below;

The shell is responsible for the execution of all the programs by analysing the line and determining the steps to be performed and then initiate the execution of the selected program.

The shell allows you to assign values to the variables when specified on the command line. It also performs Filename substitution.

The shell takes care of input and output redirection.

The shell performs pipeline hook-up by connecting the standard output from the command preceding the ‘|’ to the standard input of the one following ‘|’.

The shell provides certain commands to customise and control environment.

The shell has its own built-in integrated programming language which is typically easier to debug and modify.

Q55. Explain file system in UNIX.

All data in Unix is organised into files. A file system in Unix is referred to as a functional unit or a logical collection of files, where the disk is set aside to store files and inode entries. These directories are organized into a tree-like structure called the file system. Files in Unix System are organized into multi-level hierarchy structure known as a directory tree. At the very top of the filesystem is a directory called “root” usually represented by a / .

Summarising what has been said prior to this, the file system is a collection of files and directories and has a few significant  features mentioned below;

The very top of the file system is defined as the single directory called ‘root’ that contains other files and directories and is represented by an obelic sign (/).

These filesystems are self-independent and have no dependencies on other file systems.

Every file and directory is uniquely identified by the following;

The directory in which it resides

A unique identifier

All files are organised into a multi-level, hierarchical directory known as ‘Directory tree’.

Q56. Define inode.

When a file is created inside a directory, it accesses the two attributes, namely, file name and inode number. The file name is first mapped with Inode number and stored in the table and then this Inode number serves as a medium to access Inode. Thus, an inode can be defined as an entry created and set aside on a section of the disk for a file system. It serves as a data structure and nearly stores each information that is required to be known about a file.

This information usually includes the following details;

The File location on the disk

The Size of the file

The Device Id and Group Id

The File mode information

The File protection flags

The Access privileges for owner, group.

The Timestamps for file creation, modifications

Q57. Differentiate Swapping and Paging.

The difference between Swapping and Paging can be seen in the table below;

                                                table 2 – UNIX Interview Questions – Edureka

Q58. How would you explain a Kernel to a non-technical person?

The  kernel  is the heart of the operating system. It is the lowest level of the operating system and is responsible for translating the command into something that can be understood by the computer.  The resources allocation to different users and tasks handled by this section. The kernel doesn’t have any direct communication with the user and so, it starts a separate interactive program called the shell to each user when login to the system.

Q59. Can you enlist some commonly used network commands?

Some commonly used networking commands in Unix are enlisted below:

telnet: This command is used for remote login as well as for communication with another hostname.

ping: This command is defined as an echo request for checking network connectivity.

su: This command is derived as a user switching command.

hostname: This command determines the Ip address and domain name.

nslookup: This command performs a DNS query.

xtraceroute: This command is used to determine the number of hoops and response time required to reach the network host.

netstat: This command provides a lot of information like ongoing network connection on the local system and ports, routing tables, interfaces statistics, etc.

Q60. What is the significance of the superuser?

There are essentially three types of accounts in the Unix operating system;

The Root account

The System accounts

The User accounts

Amongst the aforementioned, the Root account is commonly referred to as the Superuser. This user has a completely open access on all files and commands on the system. This superuser account can also be assumed as a system administrator and hence, has the ability to run any command without any restriction. It is protected by the root password.

Q61. What does a pipe(|) do?

When two or more commands are required to be used at the same time as well as run consecutively, you use an operator known as the pipe(|) . What it does is it connects two commands in such a fashion that, the output of one program serves as the input for another program.

Enlisted below are a few commands where the pipe operator is used;

grep command: searches files for certain matching pattern.

sort command: arranges lines of text alphabetically or numerically.

Q62. Explain a path in UNIX.

In a file system for any operating system, there exists the hierarchy of directories, there ‘Path’ is defined as the unique location to a file/ directory to access it.

Q63. Explain the different types of pathnames that are used in UNIX.

There are basically two types of pathnames that are used in Unix. These can be defined as follows:

  • Absolute Pathname:   It defines a complete path specifying the location of a file/ directory from the very start of the actual file system i.e. from the root directory (/). Absolute pathname addresses system configuration files that do not change location. It defines a complete path specifying the location of a file/ directory from the very start of the actual file system i.e. from the root directory (/). Absolute pathname addresses system configuration files that do not change location.
  • Relative Pathname: It defines the path from the current working directory where the user is i.e. the present working directory (pwd). Relative pathname signifies current directory, parent directory as well as also refers to file that are either impossible or inconvenient to access. It defines the path from the current working directory where the user is i.e. the present working directory (pwd). Relative pathname signifies current directory, parent directory as well as also refers to file that are either impossible or inconvenient to access.

Q64. Explain Superblock in UNIX.

A SuperBlock is essentially a program that contains a record of specific file systems.

Characteristics such as the block size, the empty and the filled blocks and their respective counts, the size and location of the inode tables, the disk block map, and usage information, and the size of the block groups are available in a superblock.

There are basically two types of superblocks which are the following;

Default superblock: It has its existence always as a fix offset from the beginning of the system’s disk partition.

Redundant superblock: It is referenced when the default superblock is affected by a system crash or some errors.

Q65. Enlist some filename manipulation commands in UNIX.

Here are some filename manipulation commands along with their description, enlisted in the table below;

                                                table 3 – UNIX Interview Questions – Edureka

Q66. Explain links and symbolic links.

Links are called as a second name which is used to assign more than one name to a file. Although links are referred to as a pointer to another file it cannot be used to link filenames on different computers.

A   Symbolic link   is also known as the soft link is defined as a special type of file that contains links or references to another file or directory in the form of an absolute or a relative path. It does not contain the data actually in the target file but the pointer to another entry in the file system. Symbolic links can be used to create a file system, too.

The following command is used to create a symbolic link;

Ln –s target link_name

Here, path is ‘target’

Name of the link is represented by link_name.

Q67. What is alias mechanism? Explain.

To avoid typing long commands or to improve efficiency, the alias command is used to assign another name to a command. Basically, it acts as a shortcut to the larger commands which can be typed and run instead.

For creating an alias in Unix, following command format is used:

alias name=’command you want to run’

Here, replace the ‘name’ with your shortcut command and replace ‘command you want to run’ with the larger command of which you want to create an alias of.

For example:

alias dir ‘Is –sFC’

here, in the example above, dir  is another name for the command Is-sFC . Thus, the user now simply is required to remember and use the specified alias name and the command will perform the same task as to be performed by the long command.

Q68. Can you tell me something about wildcard interpretation?

Wildcard characters are some special kind of characters that represent one or more other characters.   Wildcard interpretation   comes into the picture when a command-line contains these characters. In this case, when the pattern matches the input command, these characters are replaced by a sorted list of files.

The Asterisk (*) and   Question mark (?) are usually used as wildcard characters to set up a list of files while processing.

Q69. Explain the terms ‘system calls’ and ‘library functions’ with respect to UNIX commands?

System calls: As the name implies, system calls are defined as an interface which basically is used in the kernel itself. Although, they may not be fully portable but these calls request the operating system to perform tasks on behalf of user programs.

The system calls appear as a normal C function. Whenever a system call is invoked within the operating system, the application program performs context switch from user space to kernel space.

Library functions:  The set of common functions that are not part of the kernel but is used by the application programs are known as ‘Library functions’. As compared to system calls, library functions are portable and can perform certain tasks only in ‘kernel mode’. Also, it takes lesser time for execution as compared to the execution of system calls.

Q70. Explain   PID.

A   PID   is used to denote a unique process id. It basically identifies all the processes that run on the Unix system. It does not matter whether the processes are running in the foreground or in the background.

Q71. What are the possible return values of kill() system call?

Kill() system   call is used to send signals to any processes.

This method returns the following return values;

Returns 0: It implies that the process exists with the given PID and the system allows sending signals to it.

Return -1 and errno==ESRCH: It implies that there is no existence of the process with specified PID. There may also exist some security reasons which is denying the existence of the PID.

Return -1 and errno==EPERM: It implies that there is no permit available for the process to be killed. The error also detects whether the process is present or not.

EINVAl : it implies an invalid signal.

Q72. Name the various commands that are used for the user information in UNIX.

The various commands that are used for displaying the user information in Unix are enlisted as follows;

id: This command displays the active user id with login and group.

last: This command displays the last login of the user in the system.

who: This command determines who is logged onto the system.

groupadd admin: This command is used to add group ‘admin’.

usermod –a: This command is used to add an existing user to the group.

Q73. What do know about tee command and its usage?

‘tee’ command   is basically used in connection with pipes and filters.

This command basically performs two tasks:

a) Get data from standard input and send it to the standard output.

b) Redirects a copy of the input data to the specified file.

Q74. Explain mount and unmount command.

Mount command:    As the name suggests, the mount command mounts a storage device or file system onto an existing directory and thus making it accessible to users.

Unmount command:   This command unmounts the mounted file system by safely detaching it. It also the task of this command to inform the system to complete any pending read and write operations.

Q75. What is “chmod” command?

Chmod command   is used to change file or directory access permission and is the most frequently used command in Unix. According to mode, chmod command changes the permission of each given file.

The syntax of chmod command is:

Chmod [options] mode filename .

Here in the above format, options could be:

-R: recursively change the permission of file or directory.

-v: verbose, i.e. output a diagnostic for every file processed.

-c: report only when the change is made.

Q76. Can you explain a little bit about command substitution?

Command substitution   is a method which is performed every time the commands that are enclosed in back-quotes are processed by the shell.  This procedure replaces the standard output and displays on the command line.

Command substitution can perform the following tasks;

Invoke sub-shells

Result in word splitting

Remove trailing new lines

Allow setting a variable to the content of the file by using ‘redirection’ and ‘cat’ command

Allow setting a variable to the output of the loop

These were all the UNIX interview questions we could think of. These UNIX interview questions would cover you for any interview you’d appear for, in the shortest possible time frame. If you have any interesting questions that have been asked to you in an interview you’ve appeared before, feel free to drop them at the comments bar and we shall answer them for you. You could also refer to this video which explains the solutions to these problems in depth.

Recommended videos for you

Linux administration : past, present & is the future, recommended blogs for you, your complete solution to shell scripting interviews in 2024, unix vs linux: difference and comparison, how to install java/jdk on ubuntu 18.04, 10 steps to create multiple virtual machines using vagrant, linux tutorial: everything you need to know to get started with linux, why do you need the different linux shells, how to install ubuntu: the complete guide, duties of a linux administrator, top reasons to master unix shell scripting in 2016, linux – making the right career choice, what is linux mint and how is it better than ubuntu, linux vs windows: which one is the best choice for you, 20 linux commands you’ll actually use in your life, how to dual boot ubuntu and windows 10 in 5 simple steps, top 50 linux interview questions for beginners in 2024, join the discussion cancel reply, trending courses in operating systems, linux administration certification training c ....

  • 14k Enrolled Learners
  • Weekend/Weekday

Linux Fundamentals Certification Training

  • 11k Enrolled Learners

Unix Shell Scripting Certification Training

  • 5k Enrolled Learners

Browse Categories

Subscribe to our newsletter, and get personalized recommendations..

Already have an account? Sign in .

20,00,000 learners love us! Get personalised resources in your inbox.

At least 1 upper-case and 1 lower-case letter

Minimum 8 characters and Maximum 50 characters

We have recieved your contact details.

You will recieve an email from us shortly.

Browse Course Material

Course info.

  • Dr. Katrina LaCurts

Departments

  • Electrical Engineering and Computer Science

As Taught In

  • Computer Design and Engineering
  • Computer Networks
  • Operating Systems
  • Software Design and Engineering

Learning Resource Types

Computer system engineering, unix assignment part 1.

Read “ The UNIX Time-Sharing System (PDF) ” by Dennis Ritchie and Ken Thompson. Recitation 4 will focus on the first four sections of the paper; Recitation 5 will focus on the rest.

To help you as you read:

  • By the end of section three, you should understand the differences between ordinary files, directories, and special files.
  • By the end of section four (along with section three), you should be able to explain what happens when a user opens a file. For instance, if a user opens /home/example.txt , what does the UNIX file system do in order to find the file’s contents? You should understand this in detail (e.g., at the i-node level). 

As you read, you may also find it helpful to think about the following:

  • What things in UNIX are named?
  • How does naming in UNIX compare to naming in DNS? How do layering and hierarchy apply (if at all)? 

Questions for Recitation

Before you come to this recitation , write up (on paper) a brief answer to the following (really—we don’t need more than a sentence or so for each question):

  • What is UNIX?
  • How is its filesystem designed?
  • Why was it designed to work that way?

As always, there are multiple correct answers for each of these questions.

MIT Open Learning

Javatpoint Logo

All Interview

Company interview, technical interview, web interview, php interview, .net interview, java interview, database interview, 22) how to check the date in unix.

To display the date in UNIX use the date command in command prompt.

Unix Interview Questions

23) How to log out in UNIX?

To log out of UNIX type the logout command in the command prompt.

24) How to perform a system shutdown in UNIX?

To perform system shutdown in UNIX, you can use the following commands:

25) How many types of files are there in UNIX?

There are three kinds of files in UNIX:

  • Ordinary files: An ordinary file is the one which contains data, text or program instructions.
  • Directories: These include both ordinary files and special files.
  • Special Files: These are the files which provide unique access to hardware such as hard drives, CD-Rom Drives e.t.c.

26) What are hidden files in UNIX?

Hidden files in UNIX are the files which have a .(dot) before the file name. These files do not show up in the traditional file manager.

Common examples of hidden files are:

27) What is the difference between a single dot and double dot in UNIX?

.(Single dot) -represents the current directory

..(Double dot) -represents the parent directory.

28) How to create files in UNIX?

Creating files in UNIX is simple. The User needs to use the vi editor to create new files.

Type vi filename in command prompt to create new files. We can also use the touch command to create a zero byte file.

29) How to display the contents of a file?

The user can use the cat command followed by the filename to display the command of a file. This command should be entered in the command prompt. The syntax of the command is shown below.

$ cat filename

Where the cat is the command to view contents of the file specified by the filename. Also if you want the line number to be displayed along with the content, you can use cat command with option -b.

30) How to calculate the number of words in a file?

To count the number of words in a file, Use the following command.

$ wc filename

Where wc is the command to count the number of words in the file specified by filename .

31) How to create a blank file in UNIX?

Blank files can be created by using the touch command, the syntax for the touch command is as follows:

$ touch filename

Unix Interview Questions

32) How to know the present working directory in UNIX?

To know the present working directory, Run the following command on the terminal.

Unix Interview Questions

33) How to know the information about a file?

To fetch the information about a file, use the following command.

$ file filename

Unix Interview Questions

34) How to change the directory in UNIX?

To change the directory, you can use the cd command in the terminal window. It changes the current directory to the specified directory.

$ cd directory-name

Unix Interview Questions

35) How to move files from one directory to other in UNIX?

In UNIX, mv command is used to move the file from one directory to some other directory.

$ mv <file-name> <destination path>

Unix Interview Questions

36) How to copy files from one directory to other in UNIX?

In UNIX, cp command is used to copy a file from one directory to some other directory. The syntax of the cp command is given below.

$ cp -r source filename destination file name.

The -r is used to copy all the content of a directory including sub-directories recursively.

Unix Interview Questions

37) How to remove files in UNIX?

To remove files, you can use the rm command. The syntax of the rm command is given below.

$ rm <filename>

we can use -r with the rm command to delete all the sub-directories recursively.

Unix Interview Questions

38) How to make a new directory in UNIX?

To make a new directory, you can use the mkdir command.

$ mkdir <directory-name>

Unix Interview Questions

39) How to remove the directory in UNIX?

To remove the directory, you can use the rmdir command. To use this command, use the following syntax.

$ rmdir filename.

Unix Interview Questions

You may also like:

  • Java Interview Questions
  • SQL Interview Questions
  • Python Interview Questions
  • JavaScript Interview Questions
  • Angular Interview Questions
  • Selenium Interview Questions
  • Spring Boot Interview Questions
  • HR Interview Questions
  • C Programming Interview Questions
  • C++ Interview Questions
  • Data Structure Interview Questions
  • DBMS Interview Questions
  • HTML Interview Questions
  • IAS Interview Questions
  • Manual Testing Interview Questions
  • OOPs Interview Questions
  • .Net Interview Questions
  • C# Interview Questions
  • ReactJS Interview Questions
  • Networking Interview Questions
  • PHP Interview Questions
  • CSS Interview Questions
  • Node.js Interview Questions
  • Spring Interview Questions
  • Hibernate Interview Questions
  • AWS Interview Questions
  • Accounting Interview Questions

Learn Latest Tutorials

Splunk tutorial

Transact-SQL

Tumblr tutorial

Reinforcement Learning

R Programming tutorial

R Programming

RxJS tutorial

React Native

Python Design Patterns

Python Design Patterns

Python Pillow tutorial

Python Pillow

Python Turtle tutorial

Python Turtle

Keras tutorial

Preparation

Aptitude

Verbal Ability

Interview Questions

Interview Questions

Company Interview Questions

Company Questions

Trending Technologies

Artificial Intelligence Tutorial

Artificial Intelligence

AWS Tutorial

Cloud Computing

Hadoop tutorial

Data Science

Angular 7 Tutorial

Machine Learning

DevOps Tutorial

B.Tech / MCA

DBMS tutorial

Data Structures

DAA tutorial

Operating System

Computer Network tutorial

Computer Network

Compiler Design tutorial

Compiler Design

Computer Organization and Architecture

Computer Organization

Discrete Mathematics Tutorial

Discrete Mathematics

Ethical Hacking Tutorial

Ethical Hacking

Computer Graphics Tutorial

Computer Graphics

Software Engineering Tutorial

Software Engineering

html tutorial

Web Technology

Cyber Security tutorial

Cyber Security

Automata Tutorial

C Programming

C++ tutorial

Control System

Data Mining Tutorial

Data Mining

Data Warehouse Tutorial

Data Warehouse

RSS Feed

  • Shell Scripting
  • Docker in Linux
  • Kubernetes in Linux
  • Linux interview question

Related Articles

Top Linux Interview Questions With Answer

Beginner-level linux interview questions.

  • 1.What is Linux?
  • 2.Explain the basic features of the Linux OS.
  • 3.Name some Linux Distros
  • 4.What are the major differences between Linux and Windows?
  • 5.Define the basic components of Linux.
  • 6.Elaborate all the file permission in Linux.
  • 7.What is the Linux Kernel? Is it legal to edit it?
  • 8.Explain LILO
  • 9.What is Shell in Linux?
  • 10.What is a root account?
  • 11.Describe CLI and GUI in Linux.
  • 12.What is Swap Space?
  • 13.What is the difference between hard links and soft links?
  • 14.How do users create a symbolic link in Linux?
  • 15.What do you understand about the standard streams?

Intermediate-Level Linux Interview Questions

  • 16.How do you mount and unmount filesystems in Linux?
  • 17.How do you troubleshoot network connectivity issues in Linux?
  • 18.How do you list all the processes running in Linux?
  • 19.What is the chmod command in Linux, and how do you use it?
  • 20.How do you check disk space usage?
  • 21.How do you find the process ID (PID) of a running process?
  • 22.What is the rsync command, and how do you use this command for synchronization?
  • 23.How do you create a user account?
  • 24.How do you format a disk in Linux?
  • 25.How do you change the password for a user account?
  • 26.What is the difference between a process and a thread?
  • 27.What is the ulimit command, and how do you use it?
  • 28.What is the find command, and how do you use it?
  • 29.What is RAID in Linux?
  • 30.What are the challenges of using Linux?

Advanced-Level Linux Interview Questions

  • 31.What is the /proc file system?
  • 32.How do you secure a Linux server?

33. What is strace command?

  • 34.How do you optimize Linux system performance?

35. How to administer Linux servers?

  • 36.What is a Linux virtual memory system?
  • 37.What do you understand about process scheduling in Linux?
  • 38.What are the most important Linux commands?
  • 39.What is the iptables command, and how to use it for network filtering?
  • 40.How do you troubleshoot a Linux OS that fails to boot?
  • 41.What is the init process in Linux?
  • 42.What is SMTP?
  • 43.What is LVM in Linux?
  • 44.What is the difference between UDP and TCP?
  • 45.What is /etc/resolv.conf file
  • 46.What is the difference between absolute and relative paths in Linux?
  • 47.What is the grep command used for in Linux?
  • 48.How do you check the status of a service or daemon in Linux?
  • 49.What is the difference between /etc/passwd and /etc/shadow files?
  • 50.How do you compress and decompress files in Linux?

51. What is the difference between a process and a daemon in Linux?

52. how do you schedule recurring tasks in linux, 53. what is the sed command used for in linux, 54. what are runlevels in linux, bonus linux interview questions, 55. what is sudo in linux, 56. what is umask, 57. how to find and kill a process in linux, 58. what is network bonding in linux, 59. what is selinux, 60. what is the purpose of the ssh protocol in linux, and how do you securely connect to a remote server using ssh, 61. how do you check the contents of a file without opening it in linux, 62. what is the purpose of the crontab file in linux, and how do you schedule recurring tasks using cron jobs, 63. how do you find and replace text in a file using the sed command in linux, 64. what is the purpose of the sudoers file in linux, and how do you configure sudo access for users, 65. how do you change the ownership of a file or directory in linux using the chown command, 66. what is the purpose of the ping command in linux, and how do you test network connectivity to a remote host, 67. how do you recursively copy files and directories in linux using the cp command, 68. what is the purpose of the netstat command in linux, and how do you view network connections and listening ports, 69. how do you set up a static ip address in linux using the command-line interface, 70. how to copy a file to multiple directories in linux.

Linux has hundreds of important concepts for you to understand before the interview. That’s why Linux Interview questions are useful in preparing for the job. These questions contain basic and advanced approaches of the field that you must learn before any interview. The correct knowledge about Linux can help you make a different spot from other candidates.

Linux-Interview-Question-and-Answer.png

Hence, learning interview questions can benefit you in competitiveness, interview success, confidence-building, and many more. If you are also preparing for a job in the Linux field, the following questions will surely benefit you. Here we have included the Top Linux Interview Questions you can learn as a beginner, intermediate, or expert.

The following 15 Linux interview questions are suitable for freshers because these questions will have basic information about Linux.

1. What is Linux?

Linus Torvalds developed Linux, a Unix-like, free, open-source, and kernel operating system. Mainly it is designed for systems, servers, embedded devices, mobile devices, and mainframes and is also supported on major computer platforms such as ARM, x86, and SPARC.

2. Explain the basic features of the Linux OS.

Some basic features of Linux are:

  • Linux is free and easily available.
  • It is more secure than other operating systems because it uses security auditing and password authentication features.
  • Linux has its personal software repository.
  • It includes multiple languages throughout the world. Hence Linux supports different language keyboards.
  • It offers CLI and GUI to use different commands and applications such as Firefox, VLC, etc.

3. Name some Linux Distros

There are various Linux distros but the following are the most commonly used:

4. What are the major differences between Linux and Windows?

The following table will help in understanding the differences between Linux and Windows :

5. Define the basic components of Linux.

Majorly there are five basic components of Linux:

  • Kernel: Linux kernel is a core part of the operating system that works as a bridge between hardware and software.
  • Shell: Shell is an interface between a kernel and a user.
  • GUI: Offers different way to interact with the system, known as the graphical user interface (GUI).
  • Application programs: It is designed to perform a bundle of tasks through a bundle of functions.
  • System Utilities: It is the software functions through which users manage the system.

6. Elaborate all the file permission in Linux.

There are three types of file permissions in Linux :

  • Read: Users open and read files with this permission.
  • Write: Users can open and modify the files.
  • Execute: Users can run the file.

7. What is the Linux Kernel? Is it legal to edit it?

It is known as a low-level software system. The Linux kernel tracks the resources and provides a user interface. This OS is released under GPL (General Public License). Hence every project is released under it. So, you can edit the Linux kernel legally.

8. Explain LILO

LILO, i.e., Linux Loader and is a Linux Boot loader. It loads the Linux operating system into memory and starts the execution. Most operating systems like Windows and macOS come with a bootloader. While in Linux, you need to install a separate boot loader, and LILO is one of the Linux boot loaders.

9. What is Shell in Linux?

In Linux, five Shells are used:

  • csh (C Shell): This shell offers job control and spell checking and is similar to C syntax.]
  • ksh (Korn Shell): A high-level shell for programming languages.
  • ssh (Z Shell): This shell has a unique nature, such as closing comments, startup files, file name generating, and observing logout/login watching.
  • bash (Bourne Again Shell): This is the default shell for Linux.
  • Fish (Friendly Interactive Shell): This shell provides auto-suggestion, web-based configuration, etc.

10. What is a root account?

The root is like the user’s name or system administrator account in Linux. The root account provides complete system control, which an ordinary user cannot do.

11. Describe CLI and GUI in Linux.

CLI , i.e., command line interface. It takes input as a command and runs the tasks of the system. The term GUI refers to the Graphical User Interface or the human-computer interface. It uses icons, images, menus, and windows, which can be manipulated through the mouse.

12. What is Swap Space?

Linux uses swap space to expand RAM. Linux uses this extra space to hold concurrently running programs temporarily.

13. What is the difference between hard links and soft links?

Here is the table that shows the difference between soft links and hard links :

14. How do users create a symbolic link in Linux?

Symbolic links, symlink , or soft links are shortcuts to files and directories. Users can create the symbolic link in Linux through the’ ln’ command. The general command to create a symbolic link is as follows:

15. What do you understand about the standard streams?

Output and input in Linux OS are divided into three standard streams: 

  • Stdin (standard input)
  • stdout(standard output)
  • stderr (standard error)

Under Linux, these standard streams channel communication of output and input between programs and their environment.

The next 15 questions are the best suitable for those who have an intermediate level of experience in Linux:

16. How do you mount and unmount filesystems in Linux?

In this case, you can use the ‘mount’ and ‘umount’ commands.

For mounting:

  • First, identify the partition through the fdisk -l command. You can also use the lsblk command for it.
  • After identifying the partition, create the directory which will work as the mount point. For example, running the mkdir /mnt/mountpnt will create the mountpnt directory as the mount point.
  • Finally, you can run sudo mount <partition> <mount_point_directory> to complete the mounting.

For Unmounting:

Once you check if the specific filesystem is in use, you can run the `sudo umount <mount_point_directory>` for unmounting. If you want to learn more about the mount command in Linux, check out this brief guide .

17. How do you troubleshoot network connectivity issues in Linux?

There are multiple ways to troubleshoot the network connectivity and find the issue correctly:

Check the Internet Connectivity:

First of all, please check if the internet connection option is on and also check the cables to find if there is any issue with it.

Verify the Network Configuration:

  • Please check that your network is configured correctly and the network interface has your IP address. You can check it by running the ip addr or ifconfig commands.
  • You can also run the ip route command to check if the default gateway is set properly.
  • Finally, verify the DNS server configuration in the /etc/resolv.conf file.

Check the Firewall:

Sometimes, firewall rules block the internet connection for the system’s security. Hence, you can run the ufw or iptables command to modify the firewall rules.

Network Interface:

You can restart your network interface through the ifup and ifdown commands. Once you restart the network interface, please reboot the system to make changes successful.

18. How do you list all the processes running in Linux?

You can list the currently running process in Linux through various commands such as:

ps Command:

The ps command displays brief information about the running processes. You can use the ps -f or ps -f command because the -f option shows the full-format result, and the -e option displays all processes. Moreover, you can use the ps auxf command to get a detailed list of processes.

top and htop Command:

  • The top command displays the real-time details about the system process and the complete resource usage.
  • The htop command is the improved version of the top command because it displays the color-coded list with additional features such as sorting, filtering, sorting, etc.

19. What is the chmod command in Linux, and how do you use it?

You can use the chmod command to change the file permissions of the directories. It offers a simple way to control the read and write permissions. For instance, if you want to change the permission of the ABC.sh script and give it the write and executable permission, you can run the below command:

The chmod command is not limited to the write (w), read (r), and executable (x) permissions because there are symbolic modes and numeric modes, which you can learn from this guide .

20. How do you check disk space usage?

There are some simple commands you can use to check disk space usage , such as:

df Command:

The df or disk-free command shows the used and the available disk space. You can use the additional options to check disk space differently. For instance, you can use the df -h command to check the disk usage in the human-readable format.

du Command:

The du or disk usage command estimates and shows the disk space usage, so running the du command with no option shows the disk usage of your current directory. However, you can run the following command to check the disk usage of a specific directory:

ncdu Command:

The NCurses Disk Usage, or ncdu command, displays more interactive disk usage. Similar to the du command, the ncdu command also requires the path of the specific directory to check its space.

21. How do you find the process ID (PID) of a running process?

You can use the following command to find the Process ID or PID of the currently running process:

pgrep Command:

The pgrep command shows the PID of a process through its name or other different attributes. For example, you can find the PID of process_1 using the below command:

ps command not only displays the currently running process but also shows the process’s PID. However, if you want to check the PID of a specific process, you can combine the ps with the grep command:

22. What is the rsync command, and how do you use this command for synchronization?

The rsync command is used to synchronize and transfer the files in Linux. It synchronizes files between two local systems, directories, or a network. The basic rsync command contains the following:

For example, let’s synchronize between Documents and the Downloads directory. For this, you need to run the following command:

If you want to go one step further, then you can use the below command:

In the above command:

  • The -a option preserves all the permissions and other attributes
  • The -v option displays the detailed output of the synchronization
  • The -z allows compression that decreases the bandwidth use.
  • The –delete option removes the file in the Downloads that do not exist in the Documents directory.

23. How do you create a user account?

You can use adduser and useradd commands to create a user for the system.

useradd Command:

Let’s create a username , “Ron,” and provide a password for accessing the system:

You can also explore the useradd command’s additional options to modify the new user’s permissions and privileges.

adduser Command:

The adduser command is similar to the useradd command, so let’s create a username “Shawn”:

24. How do you format a disk in Linux?

The mkfs or make file system command helps format the disk in the Linux system. All you need to do is use the following method to format the disk:

First, run the lsblk command to list the available partitions and identify which disk you want to format.

If the selected disk is mounted, then unmount it through the following command:

Now, find the file system type of the disk, like EXT4, NTFS, or XFS. Once you are done then, run one of the following commands according to the file system type:

Finally, mount the disk again through the mount command after the successful format. Moreover, please ensure that you have created a complete disk backup to eliminate the chances of data loss.

25. How do you change the password for a user account?

Changing the password of a user account is simple because all you need to do is use the passwd command:

For example, let’s change the password of a user “Ron” through the below command:

Once you run the command, the system will ask you to enter and confirm the new password.

26. What is the difference between a process and a thread?

In Linux, processes are the independent program, while a thread is the unit of execution. So here are the complete differences between process and thread :

27. What is the ulimit command, and how do you use it?

The ulimit command controls the resource limit for the user process. You can use the ulimit command to set the limit on the system resource to prevent consuming the higher resources. This command contains multiple options to set the limit. For example, you can use the u option to set a maximum number of processes to 50:

You can explore more options of the ulimit command by following this guide .

28. What is the find command, and how do you use it?

The find command searches for files based on different factors such as name, size, permissions, etc. Here is the basic command:

For example, let’s find a Linux.txt file located in the Downloads directory through the below command:

Once you run the above command, the find command will start finding the Linux.txt in the Downloads directory and subdirectories.

29. What is RAID in Linux?

The full form of RAID is the Redundant Array of Independent Disk that allows the system to combine the different physical disk drives into a logical unit. RAID is used to improve the system’s disk performance and data integrity. There are different RAID levels you can configure according to the requirements. Here is the detailed information about the RAID levels:

30. What are the challenges of using Linux?

There are numerous challenges that a user faces while using Linux:

  • Linux shows hardware compatibility issues in certain devices because manufacturers prioritize Windows compatibility.
  • Learning Linux is not easy because the configuration and commands require proper knowledge.
  • Although Linux supports Steam, it still needs to be impressed regarding game compatibility and availability.
  • Sometimes users face driver and firmware-related issues.

These 15 questions will revolve around your experience and help you in preparing for the advanced-level Linux interview:

31. What is the /proc file system?

/proc (Proc File System) is the virtual file system that shows information about the system and the Kernel data structures. It is the essential interface to access the system, perform debugging tasks, check the Kernel functioning, find process-related information, and many more.

Therefore, you can use /proc file system in Linux to get information about the system and modify the particular Kernel parameters at the runtime.

32. How do you secure a Linux server?

There are multiple methods to secure the Linux server and protect it from data breaches, security threats, and unauthorized access. Here are some of these methods:

  • Create a strong password
  • Update the server and apply security patches.
  • Use secured protocols like SSH and configure it to use key-based authentication for higher security.
  • Use the intrusion detection system (IDS) to monitor network traffic and prevent malicious activities.
  • Configure the firewall to limit the inbound and outbound traffic on the server.
  • Disable all unused network services.
  • Create regular backups.
  • Review logs and perform regular security audits.
  • Encrypt network traffic and enable monitoring.

The strace command is the diagnostic utility by which you can trace and monitor the system calls generated by the process. It allows you to find how programs interact with Kernel and can be used for debugging and troubleshooting. For example, let’s find the system calls generated by the ls command:

Once you run the above command, the system will start tracing the list command and show the system calls generated by it. Output from the above command includes information like call name, argument, and return values.

34. How do you optimize Linux system performance?

You can optimize the Linux performance through various strategies to improve resource usage and efficiency. So some of the strategies are:

  • Updates the system as per the latest one available.
  • Optimize the disk, enable the caching, and optimize the access pattern.
  • Manage memory and CPU usage.
  • Disable the necessary services and use lightweight alternatives of the tools.
  • Monitor the system resources regularly.
  • Perform the Kernel parameter tune-up.
  • Use tools like Performance Co-Pilot (PCP) to monitor system-level performance.

Administering a Linux server requires different strategies and management to maintain the overall functionalities. Here are some major strategies you can follow:

  • Handle user account management and assign appropriate access permissions.
  • Configure the system to optimize the performance, improve the security and maintain the network connectivity.
  • Implement the backup strategy to perform regular backups of the server.
  • Implement the monitoring tools to track resource usage, system performance, and network.
  • Set up monitoring tools to track system performance, resource usage, and network activity.
  • Configure firewall, set up intrusion detection, manage user permissions and configure the SSH.
  • Create a proper recovery planning that must include regular backup, critical configuration documentation, recovery process testing, and offsite storage.

36. What is a Linux virtual memory system?

Virtual memory is a great memory management utility in any OS. You can use the virtual memory system as secondary memory. This memory is used by both software and hardware in Linux so that your system can cope with the lack of physical memory. Moreover, virtual memory is also used to compensate for the RAM usage by transferring the data temporarily from RAM to disk storage.

37. What do you understand about process scheduling in Linux?

Process scheduling is the mechanism that identifies the order of processes running on the system. In other words, process scheduling determines the order and execution time of multiple processes running on the system concurrently. This process scheduler of Linux is priority-based and uses a preemptive algorithm. It allocates CPU time for different processes to ensure efficient CPU resource usage . These processes are dynamic, and their order can change depending on many factors, such as resource usage, process behavior, and scheduling policies.

38. What are the most important Linux commands?

There are a ton of useful commands in Linux , and here are some of the commonly used commands:

  • ls: Display directory contents such as folders and files.
  • mkdir: Used to create a new directory.
  • pwd: Shows the current directory.
  • top: Display system running processes and resource usage.
  • grep: Search a specific pattern in a file.
  • cat: Through this command, users can add multiple files and also display the content of the files.
  • tar: Archives directories and files into a tarball.
  • wget: Download files from the browser or web.
  • free: Shows memory usage.
  • df: Shows disk space usage.
  • man: Gives a manual page for a specific command that displays instructions and details.

39. What is the iptables command, and how to use it for network filtering?

The iptables command configures  Netfilter firewall rules  providing the network address translation, packet filtering, etc. iptables inspects the network packet and then manages them according to the defined rules. Here is how you can use the iptables command for network filtering: 

Run the below command to display the current iptables rules, including policies, chains, and other actions for the network:

The iptables configuration uses the predefined set of chains to process the network packages at different stages. So you can define rules to these chains for manipulating the network packets:

  • <chain>: Specifies the chain where you want to define a new rule.
  • <options>: Defines the conditions for the rule, like ports, protocols, etc.
  • -j <target>: Defines the target action when the packet matches the rule.

By default, iptables rules get automatically removed after the system reboot, but you can use the following command to make the rules persistent:

40. How do you troubleshoot a Linux OS that fails to boot?

In case of the system boot failure, you can follow various approaches such as:

  • Check the warning and error messages you get during the boot process because it can help you diagnose the issues.
  • Check the boot logs to find the exact reason behind the boot error.
  • Open the GRUB bootloader and check the boot options to solve the booting problems.
  • Check the hardware connections like cables, RAM, cooling fan, etc.
  • If the system shows an error message related to the Kernel, try to boot it with the older Kernel version from GRUB.
  • Identify the last changes you made in the system before the boot.

41. What is the init process in Linux?

The   init  or also called the initialization process is the  first process that begins during the system boot . It is responsible for initializing and processing the system in its functional state. Hence, init works as the parent process because its process ID is 1. Originally Linux systems used to have SysV init, but now it is developed as the systemd init (an improved version of SysV).

42. What is SMTP?

SMTP stands for Simple Mail Transfer Protocol. This set of communication guidelines allows the software to transmit electronic mail online. The main aim of SMTP is to set communication rules between servers. There are two models of SMTP:

  • End-to-end model: This model is used to connect different organizations.
  • Store-and-forward model: This model is used within an organization.

43. What is LVM in Linux?

The full form of LVM is Logical Volume Manager , which provides an advanced disk management approach in Linux. It is a subsystem that allows a user to efficiently allocate the disk space on the physical storage device.

You can use the LVM to create the logical volume for easy storage management through various features like resizing, volume mirroring, and snapshots. LVM is a powerful utility for disk management where you need dynamic storage allocations.

44. What is the difference between UDP and TCP?

The following table shows the difference between UDP and TCP :

45. What is /etc/resolv.conf file

The /etc/resolv.conf is the config file used for the DNS server resolution process. This config file is used to specify the DNS server, set up the search directive for domains, and configure the resolver options.

46. What is the difference between absolute and relative paths in Linux?

Absolute path = It specifies the exact location of a file or directory from the root directory (“/”). We will notice that they always start with a forward slash (“/”).

For Example : `/home/user/jayesh/geeksforgeeks.txt`

Relative paths = It specifies the location relative to the current working directory. In this we do not start with a forward slash (“/”).

For Example: `documents/file.txt`

47. What is the grep command used for in Linux?

The grep command is used to search for specific patterns within files or input streams. It allows us to find and print lines that we give to match the pattern.

For example: If we want to search `test` in a text file name “file.txt”. We use the following command

This command will search for the word `test` in the file named “file.txt” and print the matching lines.

48. How do you check the status of a service or daemon in Linux?

To check the status of a service or daemon, we can use the `systemctl` command followed by the service name.

For example: If we want to display the status of the Apache Web server. We use the following command.

It will show whether the service is running, stopped, or in an error state.

49. What is the difference between /etc/passwd and /etc/shadow files?

The /etc/passwd file stores essential user information like usernames, user IDs, home directories, and default shells. Each line in the file represents a user account.

The /etc/shadow file contains encrypted passwords and other security-related information. It is only accessible by the root user or privileged processes

50. How do you compress and decompress files in Linux?

To compress files in Linux, you can use the tar command along with gzip compression.

For example: If we want to create a file name “jayesh” with gzip compression. We use the following command.

This command will create a compressed archive file containg the specified “files”

To decompress the same, we use the following command.

A process is an executing instance of a program. It can be a foreground process that interacts with the user or a background process started by a user or another process.

A daemon is a background process that runs independently of user sessions. It is typically started at system boot time and performs system tasks or provides services. Daemons often have no user interaction and continue running even when users log out.

We can use `crontab` command for performing recurring tasks in Linux. By adding entries to the crontab file, we can specify when and how frequently a command or script should be executed

For Example: If we want to execute a script name “geeks.sh” every day at 3:30 AM. We use the following command.

This command opens the crontab file in an editor.

The sed command is used to perform text transformations on files. It can search for specific patterns and replace them with desired text.

For Example:

This command replaces all occurrences of “foo” with “bar” in the file name “file.txt”

Runlevels in Linux define different system states, such as single-user mode or multi-user mode with or without a GUI. They determine which services start or stop during system startup and shutdown. The default runlevel is often set to a multi-user mode with a GUI (runlevel 5). Runlevel 3 is commonly used for a multi-user mode without a GUI.

The next 5 Linux interview questions are the most common ones recruiters ask.

The word “ sudo ” is the short form of “Superuser Do” that allows you to run the command with system privileges. With this command, you can get the system’s administrative access to perform various tasks. The sudo command requires a password before the execution to verify the user’s authorization.

It is used for user file creation mode. When a user creates any file, then it has default file permission. Umask specifies restrictions for these permissions on the file, i.e., controls the permissions.

You can use different commands to kill a process, but first, you must find the PID of that specific process. So, please run the below command:

Once you get the PID of the process then run the kill command to end it:

If you don’t want to find the PID, then you can use the pkill command to kill a process by its name:

The pkill command sends a signal (by default, SIGTERM) to the matched processes, causing them to terminate.

Network bonding is the process of creating a single network by combining two or more network interfaces. This combination of networks improves redundancy and performance by increasing bandwidth and throughput. The major benefit of network bonding is that the overall network works fine even if a single network in the bonding does not work properly.

SELinux or also known as Security-Enhanced Linux , is the security framework. It offers an additional layer of security to improve access control and strengthen security. SELinux was developed to improve the security policies to prevent unauthorized access and exploitation. However, learning about SELinux is essential before working on it can create serious security issues.

The Secure Shell (SSH) is a protocol in Linux which is used to establish a secure encrypted connection between a local and remote machine. It allows to securely access and manage remote servers. If we want to connect to a remote server using SSH. We can use the following command.

Here replace the `username` with the desired username of the remote server and replace the `remote_ip` with the IP address of the remote server.

In Linux we can use the `cat` command to view the content of a file without opening it in an editor form.

For example: If we want to check content of a file with file_name = `geeks.txt`

The crontab file in Linux is used to schedule recurring tasks or cron jobs. It contains a list of commands or scripts that are executed at specified time intervals. To edit the crontab file, you can use the crontab -e command. 

For example: If we want to run a script name `jayesh.sh` every day at 5 AM, we can use the following procedure.

First, we need to open the crontab in editorial format.

Secondly, add the entries in the crontab file.

The sed command (stream editor) can be used to find and replace text in a file. The basic syntax is sed ‘s/pattern/replacement/g’ filename.

  For example: to replace all occurrences of “true” with “False” in a file

The sudoers file in Linux controls the sudo access permissions for users. It determines which users are allowed to run commands with superuser (root) privileges. To configure sudo access, you can edit the sudoers file using the visudo command. 

For example:

Now add this line anywhere in the file. For instance, if we want to grant a user full sudo access.

In Linux, you can change the ownership of a file or directory using the chown command. The basic syntax is chown new_owner: new_group filename. 

For example: If we want to change the ownership of a file to user “Jayesh” and group “users”.

Ping command is used to test the network connectively between the local and remote hosts. It basically sends an ICMP echo request packet to the remote host and waits for the corresponding echo reply packet.

For example: If we want to check the connectivity to a remote host, we use the following command.

Here replace `remote_host_ip` with the Ip address of the host

In linxux we can simply use `-R` option with the `cp` command to recursively copy the file and directories.

For example: 

The netstat command in Linux is used to display active network connections, routing tables, and listening ports. To view network connections and listening ports, use the netstat command with appropriate options. 

For example: If we want to display all listening TCP ports, we can use the following command.

To set up a static IP address in Linux using the command-line interface, you need to modify the network configuration file. The location and name of the file may vary depending on the Linux distribution, but commonly it is /etc/network/interfaces. Open the file with a text editor and modify the configuration to set a static IP address, subnet mask, gateway, and DNS servers.

iface eth0 inet static address 192.168.1.100 netmask 255.255.255.0 gateway 192.168.1.1 dns-nameservers 8.8.8.8 8.8.4.4

Save the file and restart the network service or reboot the system for the changes to take effect.

We can copy a file to multiple directories in Linux by these methods and command  xargs, find, tee and shell loop .

  • xargs command  on Unix/Linux operating system converts input from standard input into an argument list for a specified command.
  • The  command find  initiates a search and allows actions to be performed based on the search results.
  • The  tee command  reads standard input and copies it to both standard outputs and to one or more files.

Linux Admin Interview Questions

71.how are files organized in linux.

Linux follows a hierarchical file system structure. The root directory is denoted by “/”, and files are organized in directories or folders within the root directory.

72.How can you find the IP address of a Linux system?

The ‘ifconfig’ or ‘ip addr show’ command can be used to display the IP address of a Linux system.

73.What is the distinction between a hard link and a symbolic link in Linux?

A hard link is a direct reference to a file, whereas a symbolic link is a reference to the file’s path. Deleting a hard link does not affect the file, but deleting a symbolic link breaks the link between the file and its path.

74.How do you check the amount of disk space being used in Linux?

The ‘df’ command displays information about the disk space usage on Linux, including the total, used, and available space on filesystems.

75.How do you start and stop a service in Linux?

The ‘systemctl start <service>’ command is used to start a service, and ‘systemctl stop <service>’ is used to stop a service in Linux.

76.What are common causes of file permission issues in Linux?

Common causes of file permission issues in Linux include incorrect ownership, improper permissions set for users or groups, and conflicts between different users’ permissions.

77.How do you troubleshoot a Linux system that cannot connect to a remote server?

Possible troubleshooting steps include checking network connectivity using tools like ‘ping’, verifying firewall rules, checking DNS settings, and examining relevant log files for error messages.

Linux Troubleshooting Interview Questions:

78.what steps would you take to fix a network connectivity issue in linux.

Steps would include checking physical connections, verifying IP configuration, checking firewall settings, ensuring DNS resolution is working, and using network troubleshooting tools like ‘ping’, ‘traceroute’, or ‘tcpdump’.

79.How do you check the system logs in Linux?

System logs can be checked using the ‘tail’ or ‘less’ command to view the contents of log files located in the ‘/var/log’ directory, such as ‘syslog’, ‘messages’, or ‘auth.log’.

80.What are the possible reasons for a Linux system running out of memory?

Possible reasons include memory leaks in applications, excessive memory usage by running processes, inadequate memory allocation, or high memory demands from large datasets.

81.How would you troubleshoot a slow-performing Linux server?

Troubleshooting steps might involve checking system resource usage with tools like ‘top’ or ‘htop’, monitoring disk I/O, analyzing network traffic, identifying memory or CPU bottlenecks, and reviewing application logs.

82.What are common causes of a Linux system running out of disk space?

Common causes include large log files, excessive data storage, uncontrolled growth of temporary files, improper cleanup of old files, or runaway processes generating excessive output.

83.How can you identify and terminate a process that is using a lot of CPU in Linux?

The ‘top’ or ‘htop’ command can display the processes using the most CPU. To terminate a process, the ‘kill’ command followed by the process ID (PID) can be used.

84.How would you troubleshoot a Linux system that cannot boot up?

Troubleshooting steps might include checking hardware connections, verifying BIOS/UEFI settings, booting into a recovery mode or live system, analyzing boot logs, and diagnosing disk or file system errors.

Linux Networking Interview Questions:

85.what does the ‘ifconfig’ command do in linux.

The ‘ifconfig’ command is used to configure or display network interfaces in Linux. It can be used to view or modify IP addresses, netmasks, and other network interface parameters.

86.How do you set up a fixed IP address in Linux?

A fixed IP address can be set up in Linux by editing the network configuration file (e.g., ‘/etc/network/interfaces’ or ‘/etc/sysconfig/network-scripts/ifcfg-<interface>’) and assigning the desired IP address to the interface.

87.How do you configure a DNS server in Linux?

DNS server configuration involves editing the ‘/etc/named.conf’ (BIND) or ‘/etc/named/named.conf.options’ (ISC BIND) file to specify the server’s zone information, name resolution options, and defining forwarders or root hints.

88.What is a firewall in Linux, and how do you set it up?

A firewall is a network security system that filters and controls network traffic. In Linux, ‘iptables’ or newer ‘nftables’ can be used to set up firewall rules by defining filtering criteria, network zones, and desired actions.

89.How do you check the network connectivity between two Linux systems?

Network connectivity between two Linux systems can be checked using tools like ‘ping’ or ‘traceroute’, which send packets to the target system and report on the round-trip time and the path taken.

90.What is the purpose of the ‘route’ command in Linux?

The ‘route’ command is used to view or modify the IP routing table on a Linux system. It displays information about the network routes and allows adding or deleting routes.

91.How do you configure a Linux system to act as a router?

To configure a Linux system as a router, IP forwarding must be enabled by setting the appropriate value in the ‘/proc/sys/net/ipv4/ip_forward’ file. Additionally, network interfaces and routing tables need to be configured accordingly.

Wrapping Up

So, this was the complete information about the top 50+ Linux interview questions you need to learn to secure a good job in the Linux field. We have divided this blog into multiple parts to make the above information suitable for freshers, intermediate, and expert-level learners. If you are an experienced learner, go through the fresher and intermediate questions because it will help you recall the concepts.

Please Login to comment...

  • interview-preparation

Improve your Coding Skills with Practice

 alt=

What kind of Experience do you want to share?

Unix Interview Questions

Are you dreaming of a position as a Unix professional? And thinking of attending a Unix Interview? You are in the right place. Our Mindmajix experts posted frequently asked Unix interview questions and answers in detail here. The UNIX OS is extremely flexible and can be tailored to suit practically any current user's needs because of its complexity, adaptability, and scalability. So use these interview questions and prepare well!

  • Unix Shell Scripting Interview Questions
  • Unix Commands Interview Questions
  • Explore real-time issues getting addressed by experts
  • Test and Explore your knowledge
  • Experienced
  • Scenario - Based

FAQ’s

Unix is the foundation of many modern operating systems, and the main idea and a few shell commands are still used. So, it's very important to understand these ideas; for that, we have provided some Unix interview questions to give you a quick idea of how different Unix operating system ideas work.

Due to the demand for Unix, cracking the Interview is a little bit difficult. For this sake, we have provided the top Unix Interview questions and answers ranging from difficulty level.

Top 10 Frequently Asked Unix Interview Questions

  • What are the key characteristics of UNIX?
  • What is the syntax for UNIX commands in general?
  • In UNIX, explain links and symbolic links
  • What types of files are available under UNIX?
  • What do the different ID numbers for UNIX processes mean?
  • What does "UNIX shell" mean to you?
  • What is UNIX Superblock? Please explain.
  • Describe the UNIX file system.
  • What is the function of Unix?
  • Is Unix a coding language?

Unix Interview questions for freshers

1. what is kernel described as.

The kernel is the principal application that manages the computer's resources. This part handles allocating resources to various users and tasks. When a user logs in to the system, the kernel does not interact directly with them; instead, it launches a unique interactive application called shell for each user.

2. What is a single-user system?

A computer with a Linux kernel that is intended to be used by a sole user at a time is referred to as a single-user system . Due to affordable equipment and access to a large variety of software to carry out various tasks, these systems have grown in popularity.

What is a single-user system?

3. What are the key characteristics of UNIX?

The following are UNIX's primary features:

  • Portability independent of machine
  • Multi-user activities
  • Shells in Unix
  • A system of files in a hierarchy
  • Filters and pipes
  • Auxiliary processing units
  • Tools for development utilities.

Features of Unix

4. What is Shell called?

The shell is the term used to describe the user-system interface. For user actions, Shell receives commands and sets them to run.

5. What obligations does a shell have?

A shell's responsibilities could include:

  • Programmer activity
  • Input-output switching
  • Replacement of filename and variables
  • Pipe connection
  • Environment management
  • Language for integrated programming

6. What is the syntax for UNIX commands in general?

Generally speaking, UNIX shell commands have the following structure:

Command (-argument) (-argument) (-argument) (filename)

7. Describe the UNIX term for the directory.

A directory is a specific type of file that keeps track of all the files that are contained within it. A directory is given to each file.

8. Indicate the distinction between the connected path and the absolute path.

When a path is described as being absolute, it starts from the root folder. Refers to a path that is connected to the current place.

9. What UNIX command lists files and directories alphabetically?

With the 'ls -l' command, you can make a list of directories and files in alphabetical order. The 'ls -lt' command displays a directory and file listing in reverse chronological order of their last change.

10. In UNIX, explain links and symbolic links.

A file can also go by the name Link. It is used to give a file many names. It is not legal to link filenames on various machines or give a directory more than one name.

Unix Interview Questions For Experienced

11. what do you mean by fifo.

FIFO (First In First Out) is a particular file for date transients, sometimes known as named pipes. Data is written in a read-only format. Data is written to one end of the pipe and read from the other end during inter-process communication.

12. What does the system call fork() do?

Forking is the process of separating an existing process into a new one (). The new process id is referred to as the child process, while the primary process is referred to as the parent process. The parent process receives the kid's process id back while giving the child a value of 0. The procedure and the code run are verified using the returned values.

system call fork

13. Describe the next sentence.

Using root as the default login is not recommended.

The root account is crucial, yet when used improperly, it can quickly cause system damage. Therefore, the root account is exempt from the security measures that are typically applied to user accounts.

14. What does "Superuser" mean?

A superuser is a user who has full access to all system files and commands. Typically, the superuser login goes to root, and the root password is used to protect the login.

MindMajix Youtube Channel

15. What does process group mean?

A process group is a group of one or more processes. Each process group has its own distinct process id. The undertaking in order ID for the access patterns is returned by the method "getpgrp."

16. What types of files are available under UNIX?

Various file types include:

  • Normal files
  • File directories
  • Special character files
  • Disallow special files
  • Links with symbols

 Types of files

17. What are the behavioral differences between the commands "cmp" and "diff"?

To compare files, use both commands.

  • Cmp - Compare the two files being compared byte-by-byte and show the first inconsistency.
  • Diff - Shows the modifications that must be made for the files to be identical.

18. What functions do the commands chown, chmod, and chgrp perform?

  • Change the file's permissions by using the chmod command.
  • Change the file's ownership with chown.
  • Change the group of the file with chgrp.

19. What do the different ID numbers for UNIX processes mean?

A special integer identifies each process in UNIX called a process ID. The parent process is the one that runs to start additional processes, and its ID is designated as PPID (Parent Process ID).

The command to obtain PPID is getppid().

Every process has a unique owner who that association identifies. The procedure belongs to the owner exclusively. The user that runs the process is also the owner. The User ID serves as the user's identification. Effective User ID, which determines access privileges for resources like files, is also connected to the process.

  • Retrieve the process id with getpid()
  • The user id with getuid()
  • The effective user id with geteuid()

20. How does UNIX kill a process?

Process ID (PID) is an accepted parameter for the kill command. This only applies to processes that the command executor owns.

Unix Interview Questions Scenario - Based

21. why running tasks in the background is advantageous..

The main benefit of running processes in the background is the ability to run another process without waiting for the preceding one to finish. The shell is instructed to run a command in the background by the symbol "&" at the end of the process.

22. Compare and contrast swapping and paging.

  • Swapping: To execute, the entire process is transferred to the main memory. The activity size must be smaller than the main memory capacity to satisfy the memory requirement. Although simple, the implementation adds complexity to the system. Swapping systems do not increase the flexibility of memory management.
  • Paging: Only the memory pages that are necessary for execution are sent to the main memory. It is not necessary for the process to be smaller than the amount of memory that is available for execution. Permit many processes to load into the main memory at once.

Swapping and Paging

23. What causes a protection fault, and why?

Protection faults occur when a program accesses a page to which it does not have authorization. Additionally, a protection issue occurs when a process tries to write on a page whose copy's write bit was set during the fork() system call.

24. Why is "nohup" used in UNIX?

There is a unique command called "nohup" that can be used to run a program in the background. The "nohup" command initiates the process, which continues to run even if the user attempts to log off of the system.

25.  What does "UNIX shell" mean to you?

The UNIX shell functions as an environment for running commands, applications, and shell scripts, as well as a user-to-Unix operating system interface. The command prompt issued by Shell is "$," which analyzes input and chooses the command to run.

26. Defining the word "filter"

A programme that receives input from the normal input and outputs results after executing some operations on it is referred to as a filter. Text entered using the keyboard, data from other files, or output from other files used as input all qualify as standard input. The display screen is the default standard output. The grep command is the most well-known illustration of a Unix filter id. This software searches a file or collection of files for a specific pattern, and only the lines that contain the pattern are shown on the output screen.

27. What does the term "Kernel" mean?

The kernel, the shell, and the commands and tools make up the core components of the Unix operating system . The Unix kernel is the brains of the system, acting as a distinct interactive programme for logged-in users rather than directly interacting with users.

It accomplishes the following tasks:

  • Relates to the hardware
  • Executes actions such as task scheduling, file management, and memory management.
  • Management of computer resources
  • Aids in allocating resources to various users and projects.

28. List the main characteristics of Korn Shell.

The most cutting-edge shell is an extension of the Bourne Shell and is called the Korn Shell.

29. What are the characteristics of a Korn shell?

The following is a list of some characteristics of the Korn shell:

  • Edit commands on the command line.
  • Enables the user to check the last command issued if necessary by maintaining command history.
  • Additional structures for flow control.
  • Primitives for shellcode debugging that aid programmers.
  • Support for arithmetic expressions and arrays.
  • The ability to employ aliases, which are referred to as command shorthand names.

30. What do you mean when you refer to shell variables?

A character string that has a value assigned to it is referred to as a variable. Values can include a number, text, filename, etc. The shell allows for the creation, deletion, and assignment of variables and the maintenance of the collection of internal variables. As a result, the shell parameters are a concoction of shell-specific identifiers and given values. These variables function specifically and are local to the shell in that they are defined. They may be assigned manually using the relevant assignment command or contain default values.

31. What do you mean by node? Explain briefly.

The two attributes, file name, and inode number are accessed each time a file is generated inside a directory. The inode number is first mapped to the file name in the database before being used to access the inode. As a result, an inode can be described as an entry made and reserved on a disc segment for a file system. Almost all of the data needed to know about a file is stored in an inode, which functions as a data structure.

32. What are the actions that can be carried out by command substitution?

The following actions can be carried out by command substitution:

  • Call the subshell
  • Bring about word splitting
  • Delete any last new lines.
  • The commands "redirection" and "cat" allow you to set a variable to the contents of the file.
  • Permits assigning a variable to the loop's output.

33. What function does the superuser perform?

In the Unix operating system, accounts generally fall into one of three categories:

  • System accounts
  • Root account
  • User profiles

A "root account" is essentially a "superuser." This user has total access to or control over all of the commands and files on the system. This user can also be considered the system administrator and is, therefore free to execute any command. By using the root password, it is secured.

34. Explain pipework in detail.

The "piping" technique is utilized when two or more instructions need to be executed simultaneously and run one after the other. In this case, the output of one programme acts as the input for another because two commands are coupled. It is indicated by the letter "|."

Here are a few instructions that make use of piping:

  • The grep command looks for specific matching patterns in files.
  • Text lines are sorted alphabetically or numerically using the sort command.

35. What is UNIX Superblock? Please explain.

In Unix, the term "file system" refers to each logical partition. Each file system has a "boot block," a "superblock," "inodes," and "data blocks." When the file system is constructed, the superblock is also produced. It details what follows:

  • file system's current state
  • The partition's overall size
  • Magical figure
  • The root directory's inode number
  • Count how many files there are, etc.

UNIX Superblock

36. What do you know about wildcard interpretation?

Wildcards are a special type of character that can stand in for any number of other characters. Whenever these characters appear in a command line, they are interpreted as wildcards. When the pattern matches the command, the characters are substituted with a directory tree. Wildcard characters such as the asterisk (*) and the question mark (?) are commonly used when organizing a list of files for processing.

37. List the different commands that are used in UNIX to learn about user information.

The following is a list of the numerous Unix commands that can be used to display user information:

  • Id: Shows the login and group information for the currently active user.
  • Last: shows the user's most recent system login.
  • Who: establishes who is currently logged into the system.

The command "groupadd admin" is used to add the group "admin."

To include an existing user in the group, use usermod -a: user.

38. What do the commands mount and unmount do?

  • The mount command, as its name implies, allows users to access a disk drive or file system by mounting it on an already-existing directory.
  • The unmount command safely detaches the mounted file system in order to unmount it. This command's additional function is to alert the system to finish any outstanding read and write activities.

39. What are the types of superblocks?

Superblocks generally fall into one of two categories:

  • Default superblock: It has always been a fixed offset from the first disc partition of the system.
  • Redundant superblock: When a system crash or some faults impact the normal superblock, the redundant superblock is referred to.

40. What is Relative Pathname?

It specifies the route from the user's current working directory, also known as the current working directory (pwd). The parent directory, current directory, and files that are difficult or unpleasant to access are all denoted by relative pathnames. It specifies the route from the user's current working directory, also known as the current directory of work (pwd).

The parent directory, current directory, and files that are difficult or unpleasant to access are all denoted by relative pathnames.

41. What are the types of accounts in the Unix operating system?

  • Account root
  • computer accounts

42. Describe the UNIX file system.

A filesystem is a functional unit or logical grouping of files that is used to organize files and inode entries on a disc in Unix. This file system is made up of files arranged into a directory tree, a multi-level hierarchy.

43. What does "command substitution" mean to you?

The technique used by the shell each time it processes a command enclosed in a backquote is known as command substitution. This procedure puts it on the command line in place of the standard output.

1. What is Unix's full form?

UNiplexed Information Computing System is the full name for UNIX, which is also called UNICS. 

2. What is the main language of Unix?

Although Unix was initially developed in assembly code, it was quickly rewritten in C, a high-level programming language.

3. What is the function of Unix?

UNIX is an operating system for computers. An operating system is a program that controls a computer system's hardware and software. It tells the computer how to use its resources and when to do tasks. It lets you make use of the system's facilities.

4. Why is UNIX required?

Unix permits direct communication with the computer via a terminal, making it highly interactive and granting the user direct control over the system's resources. Unix also provides users with the opportunity to share data and programmes.

5. What is UNIX inode?

In UNIX operating systems, an inode is a data structure that carries crucial information about files within a file system. A certain number of inodes are also created when a file system is formed under UNIX. Approximately 1% of the file system's total disc capacity is typically allotted to the inode table.

6. Is Unix and Linux the same?

Linux is an operating system that is free to use. This operating system works on several different computer platforms and has several software features that help manage computer resources and let you do things. Unix is a powerful operating system that can handle many tasks at once. It acts as a link between the user and the computer.

7. What is the boot block in Unix?

A boot block is a section of an optical disc, floppy disc, hard disc, or other data storage device that has machine code that will be loaded into random-access memory (RAM) by a computer's built-in firmware.

8. What is Unix storage?

Most Unix machines use magnetic disc drives to store their files. A disc drive is a device that stores information by making electrical marks on a magnetic surface. 

9. Is Unix a coding language?

Unix was made to be a place where programmes for many different platforms could be written. So it shouldn't come as a surprise that programmers continue to use it a lot. Unix was rewritten in the C programming language early on in its history.

10. What does 777 mean in Unix?

Unix 777 mean: all can read, write, and run (full access). 

UNIX Interview Preparation Tips

  • Learn more about the interviewers and their roles at the organization to better prepare for the process.
  • Know the roles and responsibilities for the UNIX interview posted by the company. Sometimes interviewers are going to ask related questions. Practicing before an interview leads to answering well in the interview.
  • You should be ready to answer this question and know what specific aspects of the job and the organization will best suit your interests, expertise, and preferred working style.
  • The most common interview question is "Introduce yourself," so it's important to always be well-prepared to answer this. 
  • Preparing using these UNIX command interview questions helps the candidates to ace the interview confidently.
  • Always dress well and comfortably for interviews.
  • A positive impression can be left by thanking the interviewer kindly before you leave the interview room.

The article on the most popular UNIX interview questions and answers will give the candidates an idea of what kind of questions will be asked during the UNIX interview. Additionally, each question has a detailed response that can be used to further one's understanding of UNIX. Although this article will give you a general understanding of the preparation required, keep in mind that nothing beats actual experience.

Enroll your name in a UNIX Training Course if you want to learn the ins and outs of the Unix system.

Stay updated with our newsletter, packed with Tutorials, Interview Questions, How-to's, Tips & Tricks, Latest Trends & Updates, and more ➤ Straight to your inbox!

Remy Sharp

Madhuri is a Senior Content Creator at MindMajix. She has written about a range of different topics on various technologies, which include, Splunk, Tensorflow, Selenium, and CEH. She spends most of her time researching on technology, and startups. Connect with her via LinkedIn and Twitter .

scrollimage

Copyright © 2013 - 2024 MindMajix Technologies

TOP 15 Unix Interview Questions and Answers [UPDATED 2024]

Unix Interview Questions and Answers

Table of content

Unix interview questions are considered to be some of the most challenging questions in the IT industry.

Unix began as a research project at AT&T Bell Labs in the mid-1960s. It later evolved into a full-fledged operating system intended for both efficient multitasking and multi-user features. It is hardware agnostic. It is built in such a way that users may do processing and gain control through the usage of a shell. The UNIX operating system is extremely customizable and has grown into a highly sophisticated, adaptable, and scalable operating system capable of handling nearly any modern-day user job.

Before we get into the meat of the top Unix interview questions and answers, it is crucial to note that each Unix interview question in this article has been chosen by experienced hiring managers with years of experience in the industry.

15 Unix Interview Questions and Answers in 2024

Another point to take into consideration is the top Unix interview questions included in this article are sufficient, but it wouldn’t hurt to do extra study and get more information.

What are the core components of Unix?

Answer: Unix consists of three parts: the kernel, the shell, and the file programs. They are in detail further below:

  • Kernel: The kernel is the operating system’s lowest layer. The kernel, sometimes known as the core of Unix, interacts directly with the computer hardware. It is in charge of assigning and administering the resources made available to programs. It keeps track of important operations, including memory management, file management, and job scheduling. It also provides an interface for applications to access files, the network, and devices.
  • The shell: refers to a command prompt. It’s in charge of connecting the user to the operating system. The shell converts the user’s input into the language recognized by the command prompt.
  • Programs: Unix provides a wide range of tiny programs to satisfy a variety of purposes. Each Unix application only does one thing. Because of the modular design, tiny program functions may be merged and matched. This provides consumers with flexibility, allowing them to do nearly any work. While programs run on top of the shell, they can also communicate with the kernel directly.

List some features of UNIX.

Answer: UNIX includes the following features, pay an extra attention because this is one of the best and updated, and top Unix interview questions of all time:

Unix Interview Questions

UNIX supports the multiuser system: In UNIX, it is possible for many users to use the system with their separate workspace and logins i.e.it has full support for the multiuser environment.

UNIX supports the multitasking environment: In UNIX many apps can run at a single instance of time. This is also referring to a multitasking environment.

What is a single-user system?

Unix Interview Questions

Answer: A single-user system is a personal computer with an operating system designed to be operated by a single user at a given time. These systems have become more popular since low-cost hardware and the availability of a wide range of software to perform different tasks.

What is FIFO?

Answer: FIFO (First In First Out) is a particular file for date transients. It refers to pipes. In the written order, data is only readable. This is useful for inter-process communication when data is on paper at one end of the pipe and read from the other.

Describe fork() system call?

Answer: Fork is the command used to generate a new process from an existing one (). The primary process is referred to as the “parent”, while the new process id is the “child”. The parent process receives the child process id, and the child receives 0. The returned values are useful to validate the process and the code that was running.

What is Super User?

Answer: For this Unix interview question, the answer would be something like this: A superuser is a user who has access to all files and commands in the system. In most cases, the superuser login is to root, and the login is safe with the root password.

Discuss the difference between swapping and paging?

Swapping: The whole process alters the main memory for execution. The process size must be less than the available main memory capacity in order to meet the memory requirement. The implementation is simple, but it adds a burden to the system. Memory management is not more adaptable with swapping systems.

Paging: Only the memory pages that are necessary for execution are transformed into the main memory. The size of the process is irrelevant for execution, and it does not need to be less than the available memory capacity. Let several processes load into the main memory at the same time.

What is the explanation for protection fault?

Answer: Before we get to the meat of this Unix interview answer, I would like to inform you that this is one of the best and updated, top Unix interview questions of all time. A protection fault occurs when the process attempts to visit a page that does not have access authorization. A protection error is also taking place when a process attempts to write on a page whose copy on the write bit was ready during the fork() system function.

What is piping?

Answer: The term “piping” refers to the process of combining two or more instructions. The first command’s output serves as the input for the second command, and so on. The piping symbol (|) is useful to represent the pipe character (|).

What do you understand by UNIX shell?

Unix Interview Questions

Answer: The UNIX shell provides an environment in which commands, programs, and shell scripts can take place, as well as an interface between the user and the Unix operating system. Shell’s command prompt is “$,” which reads input and selects which command to run.

What do understand by Kernel?

Answer: The Unix operating system is already divided into three sections: the kernel, the shell, and the commands and tools. Instead of acting as a separate interactive application for those who have signed in, the kernel is the heart of the Unix operating system, and it does not communicate directly with users.

What do you understand by shell variables?

Answer: A variable is the name given to a character string that is useful for storing a value; values might be numbers, text, filenames, and so on. The shell keeps track of the collection of internal variables and allows for variable deletion, assignment, and creation.

As a result, shell variables are a mix of identifiers and values that live within the shell. Local variables are declared in a shell function in a specific fashion. They may have a default value or values can be changed by using the relevant assignment command.

  • This command is useful for defining a shell variable.
  • The ‘unset’ command is useful for removing shell variables

Describe the responsibilities of Shell in brief.

Answer: This is one of the most updated Unix interview questions of all time. The Shell performs a variety of functions, including evaluating the input line and beginning the execution of the program submitted by the user.

The following is a summary of the responsibilities:

  • The shell is in charge of executing all programs by evaluating the line and deciding the actions needed before launching the specified application.
  • When you use variables on the command line, the shell allows you to set values for them. Filename replacement is also in place of support.
  • To deal with input and output redirection.
  • Pipeline hook-up is doing well by connecting the standard output of the command preceding the ‘|’ to the standard input of the command following the ‘|’.
  • It includes commands for customizing and controlling the environment.
  • It has its own built-in integrated programming language, which makes it easy to debug and change.

How is the CMP command different from the diff command?

Answer: The “CMP” command is useful for comparing two files byte by byte to find the first mismatched byte. This command does not utilize the directory name and instead reports the first mismatched byte detected.

The “diff” command, on the other hand, identifies the modifications that must be made to the files in order to make the two files similar. Directory names can be useful in this scenario.

Explain what is Pid?

Answer: A PID is a unique process identifier. It essentially identifies all of the processes running on the Unix system. It makes no difference if the processes are operating in the front end or the back end.

By now, you’ve probably realized that some of Unix interview questions are challenging to answer and need extensive preparation. As you are aware, preparation is a critical phase in ensuring that a job interview goes off without a hitch. We can’t help but bring up Huru when we’re talking about job interview preparation. Huru is an artificial intelligence-powered job interview coach/ app that employs clever algorithms to prepare job seekers for their next interview. Huru’s aim is to help new and experienced applicants by offering a thorough analysis of their performance through mock interviews.

Huru’s smart algorithms enable it to thoroughly assess candidates’ performances and provide them with a report on where they fall short and where they could improve. Huru has brought a flood of fresh and unique features to the job market, such as fast feedback, over 20K mock interviews, a facial expression analyzer, and more.

Huru, on the other hand, enjoys the personalized job interview option, about which you may be wondering what it is. Because of Huru’s strong collaboration with prominent employment portals such as LinkedIn and Indeed, candidates may now conduct a customized job interview based on the specific job offer they applied for. Your unique job interview questions will be fully defined by the job description you choose.

Again, Huru became the finest job interview coach of all time by introducing novel and unparalleled features such as:

+20,000 Mock Interviews: Huru provides a diverse selection of content that covers practically every career category in the labor market. Huru allows you to practice job interview questions whenever and wherever you choose.

Instant Feedback: Using Huru’s A.I-powered simulated job interviews, you will receive immediate feedback on your performance as well as an in-depth report on how you fared and what areas need to be addressed. Preparing for a job interview might be challenging, but with Huru’s assistance, that problem is a thing of the past.

Live Coaching: Huru offers professional live coaching that will help you raise your confidence and look great before your next interview.

Facial Expression: Huru will show you how to use facial expressions to your advantage through mock interviews since they are powerful.

Personality Checker: Huru employs A.I.-based technologies to determine your personality type and assess how it influences your decision-making and behavior in job interviews, which will give you a great hand in acing Unix I

interview questions.

Voice Analysis: Huru’s powerful algorithms allow it to evaluate your voice for pauses, fillers, tone, tempo, and other factors.

Interview Recording: Huru allows you to record your interviews so that you may examine them at any time to see how you did in each fake interview.

Get Your Dream Job with Huru .

Best wishes.

unix assignment questions with answers

Elias Oconnor

Senior Copywriter

The Most Common asp.net Interview Questions and Answers [UPDATED 2024]

Pace ⎮ the optimal articulation rate in a job interview, you may also like, top 100 networking interview questions and answers you need to know in 2024.

Master your next networking interview with this extensive guide, featuring 100 crucial computer networking interview questions and answers.

The Ultimate Guide to AI for Recruitment: Revolutionizing Hiring in 2024

Adopting artificial intelligence (AI) into your recruitment AI workflow can help make the process more streamlined, helping you find and hire better candidates.

List of The Most Common Ansible Interview Questions & Answers [UPDATED 2024]

Here is a list of the most 10 common Ansible interview questions with answers in 2023

How it works

Easily practice unlimited job interviews by career position or by any job post.

Powerful features to better prepare for an interview.

Integrations

  • Educational Institutions
  • Partners (API)

Available on :

  • Google Chrome

IMAGES

  1. Unix Question and Answers

    unix assignment questions with answers

  2. UNIX MCQ Questions with answers pdf OS operating system and commands

    unix assignment questions with answers

  3. Solved CS2351 UNIX Programming Assignment #1 80 Points

    unix assignment questions with answers

  4. Introduction to unix/linux: Answers

    unix assignment questions with answers

  5. Unix Assignment Questions

    unix assignment questions with answers

  6. 4 Questions with Answers

    unix assignment questions with answers

VIDEO

  1. Unix Shell || Part1

  2. UNIX Assignment-1

  3. Unix Administration 1 Lab Activity 5.4

  4. Unix interview questions for informatica developer

  5. Unix Day16

  6. Unix Day1

COMMENTS

  1. 50 Unix Interview Questions and Answers (2024)

    By : Mary Brent Updated December 8, 2023 Here are Unix interview questions and answers for fresher as well as experienced candidates to get their dream job. Table of Contents: Unix Interview Questions and Answers for Freshers Unix Interview Questions for Experienced Unix Interview Questions and Answers for 5+ Years Experience

  2. 1000 Unix MCQ (Multiple Choice Questions)

    Here are 1000 MCQs on Unix (Chapterwise). 1. What is Unix? a) Unix is a programming language b) Unix is a software program c) Unix is an operating system d) Unix is a text editor View Answer 2. The Unix shell is both _______ and _______ language. a) scripting, interpreter b) high level, low level c) interactive, responsive d) interpreter, executing

  3. Unix Assessment Questions

    This set of Unix Assessment Questions and Answers focuses on "Redirection and Pipes - 2". 1. The category of commands which uses both standard input and standard output are called ____ a) directory oriented commands b) standard input commands c) filters d) standard output commands View Answer 2. The contents of file001 are: 232 25*50

  4. TOP 70+ Best UNIX Interview Questions with Answers

    Most Frequently asked UNIX Interview Questions and Answers: The tutorial is about the most commonly asked UNIX interview questions and answers. The main objective of the document is to measure the theoretical and practical knowledge of the UNIX operating system.

  5. UNIX

    Question 1 Which of the following commands or sequences of commands will rename a file x to file y in a Unix system? I. mv y, x II. mv x, y III. cp y, x (rm x) IV. cp x, y (rm x) UNIX 50 Operating System MCQs with Answers Discuss it Question 2 A student wishes to create symbolic links in a computer system running Unix.

  6. Unix / Linux Questions and Answers

    Unix Questions and Answers has been designed with a special intention of helping students and professionals preparing for various Certification Exams and Job Interviews. This section provides a useful collection of sample Interview Questions and Multiple Choice Questions (MCQs) and their answers with appropriate explanations. Advertisements

  7. Top 40 Unix Interview Questions and Answers

    Q1) How do you list files in a directory? Ans: The ls command is fundamental in UNIX. By default, when executed, it displays the files and directories in the current directory. It provides a quick visual overview of directory contents, ensuring efficient navigation and file management. Q2) How can you list files with detailed information?

  8. Top Unix Interview Questions and Answers in 2024

    Answer: It is done by reversing the letters of the word case, i.e., esac. 17. Give an example of a file system (hierarchy) in Unix. Answer: Unix follows many standards for its file system. The first directory is 'root', represented with a forward slash (/).

  9. Top Unix Interview Questions and Answers (2023)

    Top Unix Interview Questions and Answers (2023) - Coding Ninjas Practice Resources Login 404 - That's an error. But we're not ones to leave you hanging. Head to our homepage for a full catalog of awesome stuff. Go back to home In this article, check out the unix interview questions and answers in 2023 from basic to advanced level.

  10. 100 UNIX Interview Questions And Answers // Unstop

    1. What do you mean by UNIX? It's a lightweight operating system that's optimized for multitasking and multi-user functionality. Because of its mobility, it can operate on a variety of hardware systems. It was created in C and allows users to manipulate and process data from within a shell. 2. Explain kernel.

  11. PDF UNIX Interview Questions

    using the appropriate assignment command. Examples of shell variable are PATH, TERM, and HOME. 20) What are the differences among a system call, a library function, and a UNIX command? A system call is part of the programming for the kernel. A library function is a program that is not part of the kernel but which is available to users of the ...

  12. 60 Top Unix Shell Scripting Interview Questions and Answers

    Q #1) What is Shell? Answer: Shell is a command interpreter, which interprets the command given by the user to the kernel. It can also be defined as an interface between a user and the operating system. Q #2) What is Shell Scripting? Answer: Shell scripting is nothing but a series or sequence of UNIX commands written in a plain text file.

  13. Top 50 Unix Commands Interview Questions and Answers 2024

    What is the use of the Grep Command? What do you mean by the File System in Unix? List out the Network Commands in Unix. How would you remove a File in Unix? What are the Various IDs used in Unix Processes? What do you Understand by Permissions in Unix? What Commands would you use to get User Information?

  14. Top 75+ Unix Interview Questions and Answers in 2024

    The following are the UNIX Interview Questions listed out for you; Q1. Enlist common shells with their indicators. Q2. Define a single-user system. Q3. List a few significant features of UNIX? Q4. What is Shell? Q5. What are the basic responsibilities of a shell? Q6. What is the general format of UNIX command syntax? Q7.

  15. UNIX Assignment Part 1

    This contains the instructions and questions for the UNIX assignment 1 on "The UNIX Time-Sharing System" by Dennis Ritchie and Ken Thompson.

  16. Top 39 Unix Interview Questions (2023)

    4) What are the core concepts of UNIX. The core concepts of UNIX are given below. Kernel- The kernel is also known as the heart of the operating system. Its fundamental role is to interact with the hardware and also monitor major processes like memory management, file management, and task scheduling. Shell- It is also called command prompt, it ...

  17. Top 70 Linux Interview Questions (2024)

    Linus Torvalds developed Linux, a Unix-like, free, open-source, and kernel operating system. Mainly it is designed for systems, servers, embedded devices, mobile devices, and mainframes and is also supported on major computer platforms such as ARM, x86, and SPARC. 2. Explain the basic features of the Linux OS.

  18. Top 11 UNIX Interview Questions and Example Answers

    Example: "Kernel is the master program of a UNIX operating system. Its purpose is to control the resources of a user's computer. Kernels do not have direct communication with the user, and it starts up a separate, interactive program called Shell for each user when they login to a system.". 3.

  19. 60 Examples of UNIX interview Questions (With Answers)

    1. Do your research on the company. Before you go in for your interview, do some background research on the company. Find out what their company mission is and some facts about their history, so you can be familiar with what they may expect of you as an employee.

  20. 36 Unix Interview Questions (Including Sample Answers)

    6 interview questions with sample answers. Here are six interview questions about Unix, with sample answers for your reference: 1. Explain the kernel's relevance to the Unix architecture. An interviewer may ask this question to test your knowledge of the key components in Unix. Begin your answer by briefly defining what the kernel is.

  21. Top Unix Interview Questions and Answers for 2023

    Shiksha Online. Updated on Oct 3, 2023 12:42 IST. In this article, we will discuss top 45 questions that are asked in the interview that will help you to crack the interview. Unix is one of the most powerful multi-user operating systems. It is a highly configurable, versatile, and multi-tasking system for servers, desktops, and laptops.

  22. Top 50+ UNIX Interview Questions & Answers 2024

    Command (-argument) (-argument) (-argument) (filename) 7. Describe the UNIX term for the directory. A directory is a specific type of file that keeps track of all the files that are contained within it. A directory is given to each file. 8. Indicate the distinction between the connected path and the absolute path.

  23. TOP 15 Unix Interview Questions and Answers

    Describe the responsibilities of Shell in brief. Answer: This is one of the most updated Unix interview questions of all time. The Shell performs a variety of functions, including evaluating the input line and beginning the execution of the program submitted by the user. The following is a summary of the responsibilities: The shell is in charge ...