Tolal:85 Click:
1
2 3 4 5
Unix Interview Questions And Answers
Page 1
Ques: 1 What is UNIX ?
Ans:
UNIX is an operating system that support multi-user and multi-tasking in a time sharing enviroment.
Unix OS is used for both server and workstation.
Ques: 2 What is the kernel in UNIX?
Ans:
Kernel is the name of Operating System in UNIX. It is the kernel Job to keep each process and
user separate and to regulate to access the system hardware
Ques: 3
What is system calls? Or How does user program interact with Kernel?
Ans:
User programs interact with kernel through set of standard system calls. These system calls provide
requested service by kernel. Services like open, close, read, write or execute file and changing accessibility
of file and enable access of hardware devices.
Ques: 4
Who developed UNIX and When?
Ans:
- UNIX was developed by a group of AT&T employee at Bell Labs, including Ken Thompson, Dennis Ritchie,
Douglas Macllroy, Rudd Canaday and Tom Blakeley in 1969.
Ques: 5
What is inode?
Ans:
An inode is special file designed to be read by kernel to learn the information about each file.
It specifies the permissions on file, ownership, date of creation and of last access, and change and the
physical location of data block on the disk containing the file.
Ques: 6
What is command and syntax of command line?
Ans:
Command is a program that tells the UNIX system to do something. It has the form:
command [options][arguments]
Where an argument indicates on what command is to perform actions, usually
a file or set of files. An option modifies the command and changing the way it perform.
Option are generally precede by hyphen (-), and for most commands,
more than one option can be stung together, in the form :
command -[option][option][option]
Ques: 7 What is difference between external command and internal command in UNIX?
Ans:
In UNIX system, external commands resides in computer disks.
For ex- /bin/ls is an external command.
On other hand, internal command are built into the shell program.
For ex- exit is an internal command.
Ques: 8 How does the UNIX system indentify user?
Ans:
The system identifies you by the user id and group id assigned to
you by system administrator. You don’t need to remember your user id
and group id, the system translate username as user id and
group name as group id. You need to know your username only.
Ques: 9 What are directory navigation tools and their controls?
Ans:
Directory navigation controls are those, which are performed on directories. For ex-
ls- It show the list of directories
cd- It is used to change directory
mkdir- It is used to create new directory
rmdir- It is used to remove directory
pwd- it is used to show the path of current directory, where the user is exists.
Ques: 10
How does the user know where he is in file system?
Ans:
At any time user can determine where he is in file system hierarchy
with pwd command, (present working directory).
For ex- % pwd
Output- /home/frank/src
Ques: 11
What is use of 'cd' command?
Ans:
'cd' command is basically used for change directory.
The various use of ‘cd’ command are:
cd (also chdir in some shells) --> change directory
cd/ -->changes directory to the system's root
cd.. -->goes up one directory level
cd../.. -->goes up two directory levels
cd /full/path/name/from/root --> changes directory to absolute path named (note the leading slash)
cd path/from/current/location --> changes directory to path relative to current location (no leading slash)
cd ~username/directory --> changes directory to the named username's indicated directory
Ques: 12
What is the use of ‘rmdir’ command?
Ans:
‘rmdir’ command is use to remove directory. It is compulsory that the directory
needs to be empty before remove it and if it is also not present working directory,
then you must first change of it.
Syntax- rmdir <directory>
Ex- To remove the empty directory /home/frank/data while in /home/frank use:
% rmdir data
Or
% rmdir /home/frank/data
Ques: 13
What is the use of 'mkdir' command?
Ans:
‘mkdir’ command is use to create directory.
Syntax- mkdir [option] <directory name>
Common option
-p create parent directory
-m access permission
Ex- % mkdir /home/frank/data
Or if your present working directory is /home/frank then
% mkdir data
Ques: 14
what is the use of ‘ls’ command?
Ans:
‘ls’ command is used to list all directories and files. With option it can provide
information about size, type of file, permissions, date of file creation
and change and access.
Syntax – ls [options][arguments]
Option-
-a list all files including directories those beginning with dot(.)
-d list only name of directory not the files in directory
-al long listing
Ques: 15 What is difference between UNIX & DOS navigation & directory control commands?
Ans:
UNIX vs DOS Navigation & Directory Control Commands
Commands UNIX DOS
List directory ls dir
Make directory mkdir md &mkdir
Change directory cd cd & chdir
Remove directory rmdir rd & rmdir
Return to user’s home directory cd cd/
location in path pwd cd
(present working directory)
Ques: 16 What are the file maintenance commands?
Ans:
File maintenance commands are to create copy, remove & change permission on files. You can use the following commands—
Commands/syntax working of it.
chgrp [options] group file change the group of file
chmod [options] file change the access mode of file
chown [options] owner file change the ownership of file(only super user can do it)
cp [options] file1 file2 copy the content of file1 into file 2
mv [options] file1 file2 move file1 into file2
rm [options] file remove file or directory
Ques: 17
What is difference between UNIX & DOS file maintenance commands?
Ans:
Commands UNIX DOS
copy file cp copy
move file mv move
rename file mv rename & ren
delete file rm erase & del
display file to screen
entire file cat type
one page at a time more.less.pg type/p
Ques: 18
How do you copy file in UNIX system?
Ans:
You can copy content of a file into another file by using 'cp' command.
Syntax- cp [options] <old file name> <new file name>
Common option
-i prompt and wait for confirmation before proceeding
-r recursively copy a file
Ex- % cp <old file name> <new file name>
Now you have two copies of the file. They are completely independent of each other.
They each have their own inode, data blocks, and directory table entries.
Ques: 19 How do you rename or move a file in UNIX system
Ans:
You can rename or move file with ‘mv’ command.
Syntax-
mv [options] [old filename] [new filename]
Common Options
-i interactive (prompt and wait for confirmation before proceeding)
-f don’t prompt, even when copying over an existing target file (overrides -i)
Examples
% mv <old filename> <new filename>
Now you have a file called <new filename> and the file <old filename> is gone or deleted.
The contents of the file remain where they were
Ques: 20
How do you remove a file in UNIX system?
Ans:
You can remove a file with the ‘rm’ command.
Syntax
rm [options] filename
Common Options
-i interactive (prompt and wait for confirmation before proceeding)
-r recursively remove a directory, first removing the files and subdirectories beneath it
-f don’t prompt for confirmation (overrides -i)
Examples
% rm <filename>
Goto Page:
1
2 3 4 5
Unix Objective
Unix Objective Questions And Answers
Unix Interview Questions And Answers
Unix Interview Questions And Answers
Unix Interview Questions And Answers
Unix Subjective Questions And Answers
R4R,Unix Objective, Unix Subjective, Unix Interview Questions And Answers,Unix,Unix Interview,Unix Questions ,Unix Answers