By Fatskills Exam Guides Team — the exam nerds behind 28,500+ quizzes and 2.1M practice questions across 500+ global exams.
Unix was developed at AT&T Bell Labs by Ken Thompson and Dennis Ritchie in 1979. The first portable version of Unix was V7.
Q 1. What are the file permissions and access modes in Unix? There are three types of permissions - owner, group and other (public), all of which can be listed using the command ls -l. Each user can have one or more of the following access - read (r), write (w), execute (x). Example, -rwxr-xr-- represent the file permissions for owner, members and everyone else as -
Characters 2-4 (rwx) - means the owner has read, write and execute permission, Characters 5-7 (r-x) - indicates that the group has read and executed permission, Characters 8-10 (r--) - indicates that everyone else has only read permissions.
Q 2. What are the common directory management commands in Unix?
cd - change directory pwd - current directory mkdir - create a new directory rmdir - remove an empty directory
Q 3. What is Unix and why is it important? Unix is an operating system that supports multitasking and multi-user capabilities. Unix provides a simple and user-friendly interface for users. It is the first OS to be written in high-level (C) programming language.
Unix is important: Firstly, because of its design attributes from the initial release itself. That is, each complex task is divided into small, modular utilities that are easy to do. Secondly, during the initial internet boom, most web servers were UNIX machines from IBM, Sun, etc., hence making it a standard system for web servers.
Q 4. What is a filter in Unix? Give an example. The filter is a program that gets its data from the input stream and prints the results to the output stream. Examples - grep, sort, tail, head, cut, etc.
Q 5. What is the role of the kernel in Unix? The kernel is the central control of Unix. Kernel is the first part to be loaded when the OS loads and remains throughout the session. It executes processes, manages memory and handles interrupts and system calls. It provides drivers for controlling the hardware.
Q 6. How to install Unix on Windows 10? Unix can be installed on Windows 10 using VirtualBox, an open source virtualization tool.
Download VirtualBox (https://www.virtualbox.org/wiki/Downloads) and create a virtual machine. Select memory and virtual hard disk requirements. Download the ISO image file from a reliable source. Install the distribution in the VirtualBox in seamless mode.
Alternatively, you can install Unix in dual boot.
Q 7. What are different types of files in UNIX? The different types of UNIX files are -
ordinary files - text, data or program instructions. directories - stores regular and special files. special files - device files, used for input and output operations. pipes - temporary file that holds intermittent data until the second last command. sockets - allows advanced communication between several processes. symbolic links (soft links) - contains the path to another file (reference file)
Q 8. How to compare two text files in UNIX?
There are 3 basic commands to compare files in unix:
cmp : This command is used to compare two files byte by byte and as any mismatch occurs,it echoes it on the screen.if no mismatch occurs i gives no response. syntax:$cmp file1 file2. comm : This command is used to find out the records available in one but not in another diff
Q 9. What is the command to compare two files in UNIX? You can use the following commands to compare two files -
cmp [options] file1 file2 - compare 2 files character by character comm [options] file1 file2 - compare sorted files diff [options] file1 file2 - compare two files line by line
Q 10. How to find out what processes are running in the background in Unix? Type the command jobs to see the processes running in the background.
Example: Example - $ jobs give the output as -
[134]+ Running sleep 50 &
where 134 is the job number.
Q 11. How do you kill a process in Unix? Use the command kill along with the process id (PID) to kill a process.
Example - kill 12323
If this does not destroy the process, add the signal number for a kill to kill the process. Unix cannot ignore the signal number.
Example - kill -9 12323
Q 12.. What are a shell in Unix and its types? Shell is a program that gives us an interface between the Unix OS kernel and user. By this interfacing, the user can execute utilities and applications using the shell. Each user gets a unique shell when he logs in or opens a console. The different shells are Bourne shell (sh), C shell (csh), the Korn shell (ksh), GNU Bourne-Again Shell (bash).
Q 13. What is the difference between an absolute path and a relative path in Unix?
Absolute Path Vs Relative Path
1. the full path starting at the root directory (/). - Path in relation to the present working directory as the reference. 2. Example - /home/math/tutorial Access the current directory using the command 'pwd'. - Change the directory using 'cd'.
Q 14. What are system variables in Unix? Some system variables set in Unix by default are HOME, USER, HOST, DISPLAY, and PATH. These can be environment variables or local variables enabled by the shell.
Q 15. What are pipes and filters in Unix?
Pipes - a pipe connects small commands together to execute a complete complex task. Pipe symbol is '|.' The flow of data through the pipe is from left to right. Example - $ cat names.txt | grep 'Sam' | tee sam.txt | wc -1 Filter - Filters are used to modify the output of a command. Examples of filters are grep, sort, more, less, cat, cut and so on.
Q 16. How to find the path in Unix? To find the path, use the command - echo $PATH
Q 17. What command is used to switching between users in Unix? Use the 'su' command to switch between users in Unix.
Syntax - su [options] [username]
Q 18. How to check logs in Unix? You can check logs in the file syslog located in /etc/syslog.conf
Q 19.. What is Hardlink and Softlink in Unix?
Hardlink Vs Softlink
1. Additional name for the same existing file. Hardlink acts as a shortcut to the file that has been hardlinked. A file that points to another file through a pointer.- There is no data in the target file.
2. Preserves the contents of a file. - If the target file is deleted, softlink is rendered useless.
Q 20. What is Unix orphan process? A process, whose parent process terminates, finishes or crashes and doesn't exist anymore is called orphan process. They are adopted by the init system process.
Q 21. How zip the file in Unix? You can use the zip command to zip files in Unix.
Example - zip math.zip file1 file2 file3
Q 22. How to stop an infinite loop in Unix? To stop an infinite loop, kill the process using the 'kill PID' command.
Example - $ kill -9 24566
Join 4M+ learners. Unlock unlimited quizzes, wrong-answer tracking, flashcards + reminders, study guides, and 1-on-1 challenges.