Unix is one of most powerful multi-tasking and multi-user operating system. Unix commands and interview question and answers are explained below. All the basic UNIX commands are listed with it operation and functionality. These are the basic interview question most commonly asked in interview for fresher as well as experienced.
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?
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?
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.
$ 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.
$ mkdir govindblog
$ rmdir govindblog
|
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?
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 commandtail(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.
$ cat govindblog.txt
|
15. How to change directory?
To change the directory in UNIX, the command used is cd Below is the example:
$ cd govind1 blog1
|
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.
$ 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:
$ 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.
$ jobs
$ %process1 % process2 %process3
$ kill %process2
|
No comments:
Post a Comment