۱۳۹۳ آبان ۲۶, دوشنبه

linux question and answer for final exam

Linux module wise question bank
Code: 14BCA106- I Sem
Module 1
2 marks questions
1.       Define multiuser system.
A system which can be used by multiple users at the same time is known as multiuser system.
2.       Write any two differences between linux and windows operating system.
LINUX is virus free, WINDOWS needs antivirus.
LINUX is highly securable. WINDOWS is not securable.
3.       What is the effect of chmod 752 on the file prog.c?
ADMIN has full access to prog.c
Groupmembers can only read and execute prog.c
Individual user can only write in prog.c
4.       Mention any two versions of Linux.
Red hat,ubuntu,debian.
5.       What are the differences between rm  and rmdir?
Rm is to remove a file. Rmdir is to remove directory.
6.       Write any four advantages of cat command.
To create
To append
To check whether file exists or not.
To see the content of file.
7.       Mention any two filters in Linux .
Grep .. sort… head .. tail
8.       How do you delete the directory which contains files?
 rm -r
9.       Mention any two file comparison commands of Linux.
Comm
Diff
10.   What are the differences between ln and nl?
Ln is to link between two files.
 nl is to number the lines in a file.
11.   Mention any two disk related commands of Linux.
Du
df
12.   Who found the Linux operating system and when?
LINUS TORVALDES 1991
13.   Mention any two types of files in Linux environment.
Normal files
Directory files
Special files
14.   Mention different types of users in Linux environment.
Super user
Normal user
Network user
Pseudo user
15.   What are the differences between cp and mv?
Cp is to copy the content of one file to another
Mv is to move.
16.   Write any two uses of sed  command.
17.   Expand grep.
Globally search a regular expression and print it.
18.   What is the differences between df and du commands?
Df tells how much disk is free in particular directory or system
Du says how much disk is used in system.
19.   What does bin and etc  directories contains?
Bin contains executable programs . etc contains configuration files of the system.
20.   What do you mean by filter? Give an example of filter?
Filters are commands that sorts the content of the file.
Grep is a filter.
21.   What is the meaning the this command:$who | sort logfile > newfile?
The output of who will be taken as input for sort . and then displayed.
The content of logfile is written to newfile.
22.   What will be the effect of the command umask 022?
23.   What do you mean by multiuser and multitasking operating system?
N number of users can use system at once. Multiuser
N number of tasks can be run at once. Multitasking.
24.   Write any two feature of Linux operating system.
Highly stable.
Free
Securable.
25.   Which are the different types of shells available in linux?
C shell
Korn shel
Bash shell
Tcsh shell
26.   Mention any two security mechanisms in linux?
Security at user level .. like login syste,
Security at directory/file level.. like file permission using chmod
27.   How will you remove a directory tree even it is not empty and without using rmdir?
Rm -r
28.   How does the command mv bar1 bar2 behave when bar2 exists and bar2 not exists?
When bar2 exists.. it will be over written
When bar2 doesn’t exist . a new file will be opened and then it will be moved.
29.   How will you display only the lines common to two files?
Using comm command
Syntax : comm File1 file2
30.   What is the difference between cat foo and cat>foo? Why do you have to use Ctrl-d in one and
not in in the other?
Cat foo displays the content of file and exists to $ prompt . so no need to use ctrl D
Cat> foo creates file.. and we can enter the content as much as we need and then end it by pressing ctrl D
31.   Describe the grep command used for searching a pattern with any 2 examples.
Grep h bca
Grep –w hibos bca
32.    Which are the two options compulsory in cut command ?
Cut –c (anynumber ) filename
Cut –f (anynumber) filename
5 marks questions
1.       Write any five differences between linux and windows operating system.
2.       Explain the features of Linux file system.
1.Hierarchial file structure.
2. File can grow dynamically.
3. File have access permission
4. all devices are implemented as files.
((This contains a Diagram … PLEASE GOOGLE IT))
3.       Explain the benefits or advantages of Linux operating system.
1.Highly stable
2. Multiuser system
3.Multitasking OS
4. HIGH performance
5. free
6. virus free
7. highly securable
8.Easy installation
9. open source
10.choice
4.       Write a note on history of linux.
In 1991, a Finnish university student named Linus Torvalds was unhappy with Microsoft DOS and Windows 3.1, but really liked the UNIX systems he used at school. Unfortunately, UNIX was not cheaply available for home use, so he decided to write his own, free version.

5.       Explain any two Linux flavors.
UBUNTU
Was developed by an African millionaire MARK SHUTTLEWORTH .. UBUNTU IS THE LEADING DEVELOPER OF LINUX. N number of versions are there in ubuntu.. the average time span for the versions are six months. Latest is ubuntu 14.04 . These are free and very easy to install. It is based on debian.
FEDORA.
2003 it was realeased. 2nd most popular vendor.
It is based on red hat. What makes this popular is that this has good security measures. Six months release scheldules.


6.       Explain any five Linux commands with examples.
Write any five CIA commands guys.
7.       Explain the uses of cat command with their syntaxes.
SAME CIA.
8.       Discuss about the file permissions.
Read chmod.. full..
9.       Write a note on security of file in linux.
10.   What are the uses of sed  command.
11.   Explain any two file comparison commands.
12.   Explain date command with any four options.
Date is used to display system date.
Date –d gives the date In string..
Date %Y gives year
Date %H gives hour
Date %m gives month

13.   Explain the usage of grep command .
It is used to search for an expression and print it.
Example. Grep h bca
Any line that has h at first will be printed
14.   Explain the root directory structure of linux.
Diagram..
15.   Explain any two filters in linux with minimum two options.
Grep –I  h bca .. ignore case sensitive
Grep –w hasd bca .. it should match the perfect word
Grep –x asdnadsnads bca .. it should match whole line.
Sort –b .. ignore blanks
Sort –f … ignore case sensitive
16.   Write a note on disk related commands In linux.
17.   Explain the chmod command in linux.
18.   Write a note on sed command.
19.   Briefly describe any five basic commands  with suitable example.
CIA commands.





10 marks questions
1.       Explain the benefits of Linux operating system.
2.       Explain different flavors of Linux operating system.
3.       Explain any five commands with syntax and related examples.
4.       Explain the file permissions with respect to characters and numbers.
5.       Write the installation steps for Ubuntu operating system.
6.       Explain any ten basic commands in linux with suitable examples.





Module 2
2 marks questions
1.       What is an inode?
Inode is an unique number given for a file. Its like serial number. A file can be accessed by inode number also.
2.       Define boot strap loader.
Software present in boot block which loads the OS into memory when computer is turned on.
3.       What is the command used to find the inode number of  a file.
Ls –i.
4.       What does inode block contain?
Info about owner, to which group he belongs, size of files, data and time, file permissions.
5.       What does inode table contains?
The inode table contains the list of all inode numbers  of respective file system.
6.       Define system call.
Call made to the kernel on behalf of user by an interrupt.
7.       What are hard links In Linux?
Hard links are link between two files. When two files are hard linked. The content of first file will be copied to another file.
8.       Mention different blocks of unix  file system
Boot block
Super block
Inode block
Data block
9.       Write any two qualities of soft link.
These create a a link to another file which contains same inode number
If first file is deleted then other file is also deleted.
10.   What is the difference between mounting and un mounting?
Mounting is to add the files of external device into system.
Unmounting is to detach the files of external device.
11.   What is the difference between stat and fstat commands?
12.   Define pipe and give an example.
Pipe is a command used to combine two commands . the output of first command will be the input for second.
$who|sort > okay
13.   How do you create link to the file?
By using the command ln
14.   Write difference between soft link and hard link.
Mentioned above
15.   What is the command used to change the owner of the file.
Chown is the command.
16.   What is the command used to create a special file?
17.   Write any characteristics of hard link.
Mentioned above.
5 marks questions
1.       Write the structure of regular file.
2.       Wirt a note on super block and inode block
Super block – contains state of file,, number of blocks free with their location ,, number of block used.. total storage size.
Inode block contains details about owner , file permissions, date and time, size of files, group to which owner belongs to.
3.       Explain different blocks belonging to file in linux.
Boot block , super block, inode block. Data block. Explain in your own words guys.
4.       List any five system calls with their use.
Fork() – to start a process
Exit()-to stop or terminate a process
Wait() – waiting for death of child. Parent picks up this using wait
Getpid()- get process id
Getppid()-get parent process id
5.       Explain mounting and unmounting with related commands.

6.       What is the difference between soft link and hard link.
7.       Explain pipe features with related examples.

10 marks questions
1.       Explain different blocks of the Linux file system.




Module 3
2 marks questions.
2.       Define process.
Any running instance of program . or program in execution.
3.       Define scheduler.
A ssoftware inbuilt… which decides the priority of the files and sends the ready to run files for kernel to execute.
4.       What is the difference between pid and ppid.
Pid is the process id .. ppid is parent process id.
5.       Write any two options of ps command.
Ps –f.. full info
Ps –e.. both user running process and system .
6.       How to kill a process.
Using kill()
7.       Define daemon process.
Long running backgroung process
8.       How do you run a process in the back ground?
By adding & at the end
9.       Which are the different states in which a process can be?
Initial state.
Waiting state.
Ready to run .
Terminated.
Running.
10.   What are daemons In Linux?
Processes running in background.
11.   How to check process running on a particular terminal?
12.   What is the command used to find the PPID of process?
Ps -f
13.   Define process table.
It is the data structure within kernel which contains all info about current processes.
14.   How do you run a process even when user logout?
Using nohup .




5 marks questions
1.       Explain the different states of a process.
2.       Write a note on context of a process.
3.       Explain the mechanism of process creation.
4.       Explain how to control a process.
5.       Explain how to terminate a process?
Kill –hup (name)   restarts
Kill –stop (ppid) stops that id
6.       Explain ps command with any four options.
Ps –f .. full status , even showing the parent
Ps –e .. both user and system process
Ps –r .. only the currently running process
Ps –U .. only user running process
Ps –l .. long ist , shows even memory related info.

7.       Define a process and what is pid and ppid?
Process is a running instance of program . or program in execution
Pid is process id.. every process has id. Which is unique.
Ppid is the parent process id. If N number of processes has same PID. Its good to kill the parent of that .. instead of deleting individually.


10 marks questions
1.       Explain process states and transitions with neat labeled diagram.






MODULE 4

2 marks questions
1.       What is vi editor?
Visual editor , using to write modify and save a file.
2.       What are the features of vi editor
Three different operating modes making it easy to use.
Full screen.
Cannot use fonts and styles.
3.       What are the operating modes available in vi editor?
Command mode,
Input mode.
Execution mode.
4.       How will you switch to insert mode from command mode and vice versa?
I .. will go to input mode.. esc will come back to command mode.
5.       Write the syntax to create a vi editor file
Vi filename
6.       How will you open an already created vi editor file?
Vi alreadyexistingfilename
7.       Write the syntax to save a vi editor file
In execution mode. :w
8.       Write the syntax to exit a vi editor file
In execution moge. :q!
9.       How will you save and exit a vi editor file?
In execution mode. :wq
10.    Write the syntax to save and quit the read only file

11.    Write the syntax to save file and quits in editing mode

ZZ
12.    What is the difference between r and R command?
r>> replaces character under cursor
R >> replaces full content to the right of cursor
13.    What is the difference between s and S command?
s>> replace one character with many character
S>> replace whole line
14.    What is the difference between o and O command?
Open a new line below cursor o
Open a new line above cursor O
15.    What is the purpose of x and X command?
x>> deletes the character under cursor
X>> deletes the character left to cursor.
16.    How will you delete  a character under cursor?
x
17.    How will you delete 2 characters under cursor?
2x
18.    How will you delete an entire line under cursor?
dd
19.    How will you delete and replace a character under cursor?
r
20.    How will you move cursor to the top of the screen?
H or shift h
21.    How will you move cursor to the middle of the screen?
M
22.    How will you move cursor to the bottom of the screen?
L
23.    What is the purpose of z , z+ , z- commands ?
Z+ to adjust the screen so that cursor is at the top of the screen
Z  middle of the screen
Z- bottom of the screen
24.    How will you insert a character before cursor?
i
25.    how will you append a character after cursor?
a
26.    how will you append a character at end of the line?
A
27.    Write a command to search a specific word.
28.    How will you move cursor to last line of the file?
G
29.    write the syntax to search a specific word and replace the word
%s/findingword/replacingword/g
30.    List out the no. of flags available in search and replace commands and explain it in detail
31.    List out the commands which are communicating with other users in Linux.
Write
Wall
Mail
Talk
32.    write the syntax to send a mail to multiple users
mail –s subject mailid1,mailid2
33.    what is the purpose of mesg command and explain it in detail?
Mesg command is to approve or deny the permission for write command
Mesg n will deny
Mesg y will approve
34.    How to send a mail with subject, cc and body?
Mail –s subject mailid
Cc:
Adsnldasndlasn

35.    how ftp is used in communication ?
ftp is file transfer protocol .. which connects to a particular host and used to transfer files .
36.    explain in detail about mail command
37.    How will you copy a line x if the cursor is in line y?
Execution mode.
:x cp y


5 mark questions

1.       Explain the operating modes in detail
2.       Explain cursor movement commands in vi editor
3.       Explain briefly about inserting and deleting commands in vi editor
4.       What are the options in ftp command and explain in detail
5.       Explain in detail about who command
6.       Write short notes on wall command
7.       Explain briefly about search and replace commands
8.       Explain briefly about yanking with examples
9.       Explain briefly about inserting and deleting commands in vi editor
10.    Explain briefly about searching in vi editor
11.    Explain briefly about screen movement commands
12.    Explain about cursor movement commands

10 mark questions

1.       Explain briefly about communicating with other users

Module 5
2 mark questions
1.       What are the common administrative tasks of system administrator in Linux?
The main and common job is the management of whole system .. maintaining user accounts, managing disk space, maintaining security .
2.       How to identify the administrative task of a system administrator?
3.       What is the role of system administrator?
A system administrator, or sysadmin, is a person who is responsible for the upkeep, configuration, and reliable operation ofcomputer systems; especially multi-user computers, such as servers.
The system administrator seeks to ensure that the uptime, performance, resources, and security of the computers he or she manages meet the needs of the users, without exceeding the budget.
4.       What are the responsibilities of system administrator?
5.       How to create a new user in Linux .
#Useradd (username )  .. is the syntax to add user .
6.       How will you add a new user?
Same as above.
7.       How to add a new user in to a group
#Useradd –G (groupname) (username) .. is the syntax to add user to group.
8.       How to change the password for the particular user
#Passwd (username)
9.       What is the purpose of su and sudo command in Linux
Su command is to attain super user . by login process using root password.
Sudo command is to attain super user without root password.
10.    Write the syntax and attributes of su and sudo command in Linux
$su
Password: anything
$sudo   command
11.    How to modify the user account options
Usermod (username) is the syntax
12.    How to add a user to multiple groups?
Usermod –a –G group1,group2,groupn username
13.    How will you create a user with password expiry date?
14.    Is it possible to disable a particular user account temporarily?
Usermod –e yyyy-mm-dd username . here –e means expire date.
15.    How to delete a particular user account
Userdel (username)
16.    What are the attributes used in deleting user account?
Userdel (username) simply deletes the user
Userdel –r (username) deletes all his files and documents.
Userdel –f(username) forces the user to be deleted even if he is logged in.
17.    How to add a new user temporarily?
18.    How to switch from normal user to root user?
Using  su command.
19.    Explain in detail about becoming super user using su.
By using su
And then the root password a normal user can switch to super user and get access to full system features. Like adding user adding group ,, etc. enough.
20.    How to get system information with uname, host name?
uname gives the details about, name , version of the OS.. hostname gives details about host and domain of OS.
21.    How to install and remove the packages as an administrator?
22.    How will you change the ownership of an user account?

3 Mark questions

1.       Explain in detail about log files in linux
2.       Explain the file permissions in linux
3.       Explain in detail about disk partitions in linux
4.       Explain about uname and host name in linux
5.       Explain in detail about ownership of user accounts
6.       Explain the file security in linux
7.       Explain in detail about linux system monitoring performance.
8.       How to create a group and add a new user in it.
9.       Explain in detail about file system mounting in linux.
10.    What is super user and explain it in detail.
11.    What is root user and explain it in detail.
12.    Explain in detail about creating and managing groups.

10 Mark Questions

1.       Explain briefly about managing user accounts
2.       Explain in detail about log files