Unix Questions And Answers
1. What is UNIX?
UNIX was developed by
AT & T Bell labs during 1970’s. UNIX is multi-user, multi-tasking operating
system. UNIX uses Shell as a commands for interface between users and machine.
2. What is Shell?
Shell is used for
interaction between user and operating system. By using shell, users can typed
commands for their task and
3. What is the
different between multi-user and multi-tasking?
Multi-user means,
there can be more than one user profile in the operation system whereas
multi-tasking means, operating system can performs multiple operations at a
time.
4. What are the basic
UNIX commands for File and Directory Management?
1
2
3
4
5
6
7
8
9
10
|
cd – change current directory
cp – copy file
mkdir – make directory
mv – move directory or file
rm – remove files
rmdir – removes directory
ls – list directory
chmod – changes the protection mode of the directory
grep – search for the file
cmp – compare files
|
5. List the UNIX
Commands for File Display and printing?
1
2
3
4
|
cat – shows all files of directory
lpr – prints the file
head – shows first few lines of file
tail – shows last part of the file
|
6. What is
kernel?
Kernel is the
essential parts which act as mediator for computer hardware and software input
and output requests and it also handle memory managements.
7. Who is Super user?
Super users is the
administrative in the operating system account which has all the authority i.e.
can add user, remove them, set files inaccessible to other users and so on and
super users are called as system administration.
8. Write Hello World
program by using UNIX command?
The Hello World can be
display in the command line by using echo command.
1
2
|
$ echo Hello World
Hello World
|
9. What is chmod
command?
chmod command in UNIX changes the file
protection mode of the directory.
10. How to create and
remove directory?
Perform the following
commands for creating and removing directory in UNIX, mkdirand rmdir are
used.
1
2
|
$ mkdir freshersemploy
$ rmdir freshersemploy
|
11. How to display
time?
By using date command,
we can display the time and date in unix.
12. List some of the
process control commands?
1
2
3
4
|
bg – put suspended process to background
fg – bring process into foreground
jobs – list all the process
^z – suspends current process
|
13. How to
display first and last part of the file?
The first part of the file
can be displayed by using head(which shows few lines from starting
of the file) whereas the last part of the file can be display with UNIX
command tail(which display last few line of the file).
14. How to read a file
in UNIX?
The command used for
reading the file in UNIX is cat. Example is shown below.
1
|
$ cat freshersemploy.txt
|
15. How to
change directory?
To change the
directory in UNIX, the command used is cd Below is the
example:
1
|
$ cd freshers1 employ1
|
16. In UNIX, how
to search for a file?
grep is the UNIX command used for searching
files.
17. Which UNIX command
is used for copying files?
The command used for
copying files is cp. The example is given below.
1
|
$ cp file1 file2
|
18. How to print
a file?
To print a file, lpr UNIX
command is used. Example for printing the file is given below:
1
|
$ lpr file1
|
19. Explain
Process in UNIX?
A process is an
executing programs which may be run in background, foreground and the process
can be suspended. Process is identified by a unique PID i.e. Process
Identifier.
20. How to list and
kill the background process in UNIX?
To display list all
the process running either in background, foreground or suspended, use jobs
command. To terminate a certain process, kill command is used.
1
2
3
|
$ jobs
$ %process1 % process2 %process3
$ kill %process2
|
Comments
Post a Comment