- Information
- AI Chat
Unix interview questions and answers
Software Engineering (CS530)
Visvesvaraya Technological University
Recommended for you
Preview text
Unix Interview Questions
A list of top frequently asked Unix interview questions and answers are given below.
1) What is Unix?
UNIX is a portable operating system that is designesystem, it can run on different hardware platforms. It is written in C language. It was developed by Kd for efficient multitasking and multi-user functions. Since it is a portable operating en Thompson, Dennis Ritchie, Douglas McIlroy, and Joe Ossanna.
2) List the distributions of UNIX.
UNIX has many distributions including Solaris UNIX, AIX, HP UNIX and BSD and many more.
3) List some features of UNIX.
UNIX includes the following features: UNIX supports the multiuser system: logins i.e has full support for the multiuser en In UNIX it is possible that many users can use thevironment. system with their separate workspace and
UNIX supports the multitasking environment: multitasking environment. In UNIX many apps can run at a single instance of time this is also known as a
4) What are the core concepts of UNIX
The core concepts of UNIX are given below.
o 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. o Shell- It is also called command prompt, it connects the user to the operating system, whatever is typed by the user is translated into the language understood by the command prompt, and then the corresponding actions are performed. o Commands and Utilities- Many built-in commands help the user perform day to day activities,cat,cp,and grep etc. Some of the examples o Directories- Every bit of data is stored in files, and these files are stored in directories, these directories combine to form a tree- like structure.
5) What is a UNIX shell?
The UNIX shell is a program which is used as an intbut it can communicate directly with the server. erface between the user and the UNIX operating system. It is not a part of the kernel,
6) What is filter?
A filter is a program that takes input from standaroutput. d inputs and performs some operation on that input to produce a result as standard
7) What are the devices represented in UNIX?
All devices in UNIX are represented by particular files that are located in /dev directory.
o zsh - Z Shell o ksh - Korn Shell
12) What are the main features of Korn Shell?
o Arrays o Job control o Command Aliasing o String manipulation ability o Built-in integer arithmetic
13) What is the difference between cat command and more command?
The cat command is used to display the file contentscreen page by page If the file is large and you have to scroll off the screen before you view it on the terminal, whereas more command is used like a pager which displays the
14) Which command is used to restrict incoming messages?
The "mesg" command is used to restrict incoming messages.
15) Which command is used to kill the last background job?
The "kill $!" Command is used to kill the last background job.
16) Which data structure is used to maintain the file identification?
The "inode" data structure is used to maintain the file identification. Each file has a separate inode and a unique inode number.
17) What a pipe?
A pipe is used to join two or more commands by usincommand through the pipe. g a pipe "I" character. The output of the first command is propagated to the second
18) What are the links and symbolic links in a UNIX file system?
A link is a second name for a file. Links are used more than one name or link filenames on different cto assign more than one name to a file, but cannot omputers. be used to designate a directory
Symbolic links are the files that only contain the name of another file. The operations on the symbolic link are directed to the file pointed by it. Both the limitations of connections are eliminated in symbolic links.
19) Explain system bootup in UNIX.
System bootup is the first thing that takes place wis fired up and checks if all the hardware connected to the system are working correctly, after being hen the power button is pressed in UNIX. Whenever tsuccessful the system asks the user he power button is pressed, BIOS to provide authentication.
according to their size, then you can use (ls -lhS) command.
ls -l - -block- size=[SIZE]
It is used to display the files in a specific size format. Here, in [SIZE] you can assign size according to your requirement.
ls -d */ It is used to display only sub directories.
ls -g or ls -lG With this, you can exclude column of group information and owner.
ls -n It is used to print group ID and owner ID instead of their names.
ls --color=[Value]
This command is used to print list as colored or discolored.
ls -li This command prints the index number if the file in the first column.
ls -p It is used to identify the directory easily by marking the directories with a slash (/) line sign.
ls -R It will display the content of the sub-directories also.
ls -lX It will group the files with the same extensions together in the list.
ls -lt It will sort the list by displaying a recently modified file at the top.
ls ~ It gives the contents of the home directory.
ls ../ It gives the contents of the parent directory.
ls --version It checks the version of ls command.
22) How to check the date in UNIX?
To display the date in UNIX use the date command in command prompt.
23) How to log out in UNIX?
To log out of UNIX type the logout command in the command prompt.
o .kshrc o .rhosts o .cshrc
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 ficommand prompt. The syntax of the command is shown lename to display the command of a file. This commabelow. nd should be entered in the
$ cat filename Where the cat is the command to view contents of thalong with the content, you can use cat command wite file specified by the filename. Also if you want h option -b. the line number to be displayed
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
33) How to know the information about a file?
To fetch the information about a file, use the following command. $ file filename
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
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.
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.
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 and answers
Course: Software Engineering (CS530)
University: Visvesvaraya Technological University
- Discover more from: