You are not logged in.

#1 2015-02-19 05:24:52

Muhammad
User RankUser RankUser RankUser RankUser RankUser Rank
بِسمِ اللَّهِ الرَّحمٰنِ الرَّحيمِ
From: Sahiwal Division
Registered: 2012-03-22
Posts: 22,197
Website

Linux Operating System Management Interview Questions And Answers

Operating System Linux :: Linux OS Management Job Interview Questions and Answers

Linux OS Management frequently Asked Questions by expert members with experience in Linux Operating System Management. These questions and answers will help you strengthen your technical skills, prepare for the new job test and quickly revise the concepts

1 Which of the following time stamps need not exist for a file on traditional unix file system:  a) Access Time  b) Modification Time  c) Creation Time  d) Change Time
2 Which command is used to set limits on file size:  a) fsize  b) flimit  c) ulimit  d) usize
3 Which option of rmdir command will remove all directories a, b, c if path is a/b/c:  a) -b  b) -o  c) -p  d) -t
4 Which represents the user home directory:  a) /  b) .  c) ..  d) ~
5 If a file is removed in Unix using 'rm' then:  a) The file can be recovered by a normal user  b) The file cannot be recovered by a user  c) The file can be fully recovered provided the sytem is not rebooted  d) The file will be moved to /lost+found directory and can be recovered only by administrator's intervention
6 What command is used to copy files and directories?  a) copy  b) cp  c) rn  d) cpy
7 Any file's attribute information is stored in which structure on the disk:  a) Inode  b) Data blocks  c) File blocks  d) Directory file
8 Executing the 'cd ..' command when at the root level causes:  a) Error message indicating the user can't access beyond the root level  b) Behavior is unix-flavor dependent  c) Results in changing to the 'home' directory  d) Nothing happens
9 How do you rename file "new" to file "old"?  a) mv new old  b) move new old  c) cp new old  d) rn new old
10 What UNIX command is used to update the modification time of a file?  a) time  b) modify  c) cat  d) touch
11 When mv f1 f2 is executed which file's inode is freed?  a) f1  b) f2  c) new inode will be used  d) implementation dependent
12 Where can I find the printer in the file structure?  a) /etc  b) /dev  c) /lib  d) /printer
13 Which of the following statement is true?  a) The cp command will preserve the meta data of the file  b) The sort command by default sorts in the numeric order  c) The mv command will preserve the meta data of the file  d) The command ps will display the filesystem usage
14 Creation of hardlinks that point across partitions:  a) is allowed only to root user  b) Can be done by all users  c) The effects are unspecified  d) is not allowed
15 Which command is used to change permissions of files and directories?  a) mv  b) chgrp  c) chmod  d) set
16 If two files on same partition point to the same inode structure they are called:  a) Soft links  b) Hard links  c) Alias  d) Special files
17 Deleting a soft-link:  a) Deletes the destination file  b) Deletes both the softlink and the destination file  c) Deletes just the softlink  d) backup of the destination is automatically created
18 A user creates a link to a file file1 using the following command "ln file1 file2". Which of the following is not true?  a) file1 and file2 have the same inode numbers  b) The number of links for file1 is displayed as 1  c) The number of links for file1 is displayed as 2  d) The number of links for file2 is displayed as 2
19 How many links are created when we create a directory file?  a) 1  b) 2  c) 3  d) 4
20 Which among the following allows fast file system recovery?  a) Ext2  b) Journaling  c) Caching  d) Sysfs
21 There are two hard links to the "file1″ say hl and h2 and a softlink sl. What happens if we deleted the "file1″?  a) We will still be able to access the file with hl and h2 but not with sl  b) We will not be able to access the file with hl and h2 but with sl  c) We will be able to access the file with any of hl, h2 and sl  d) We will not be able to access the file with any of hl, h2 and sl
22 By default if any regular file is created, the number of link is displayed as 1?  a) True  b) False
23 Which command is used to check filesystem usage in a system?  a) mount  b) df  c) du  d) dd
24 Filesystem for CDROM is:  a) Ext2  b) Ext3  c) Isofs  d) Procfs
25 Which command is used to mount file system read only?  a) mount -a  b) mount -v  c) mount -f  d) mount -r
26 Which filesystem can be used to change certain kernel parameters at runtime using sysctl command?  a) Ext3  b) Sysfs  c) Ext4  d) Procfs
27 Which file contains the filesystems to be automatically mounted during boot?  a) /etc/mount  b) /etc/fstab  c) /etc/inittab  d) /etc/boot
28 Nohup is used to:  a) automatically hang up the process after logout  b) continue the process after logout  c) create backgroung process  d) manually hang up the process after logout
29 We can change the priority of a running process using:  (a) nice  (b) renice  (c) priority cannot be changed for a running process  (d) only superuser can change the priority
30 The signal sent to a process when the Ctrl-C key is pressed is:  a) KILL  b) TSTP  c) TERM  d) INT
31 Which of the following values for STAT column of ps command is not true:  a) status R means running  b) Status S means sleeping  c) Status E means exited  d) Status Z means zombie
32 Which file system has journaling capability?  a) Ext2  b) Ext4  c) Isofs  d) Procfs
33 ____ is a directory (which should exist), on which to mount the file system?  a) Root  b) Boot  c) Mount-point  d) Partition
34 A user issues the following command sequence:  $ a.out &  $ bash  $ a.out &  If the user kills the bash process, then which of the following is true?    a) The second a.out process is also terminated  b) The second a.out process becomes a defunct process  c) The first a.out process becomes a zombie process  d) init process becomes parent of second a.out process
35 When a child process exits before the parent process exits, which of the following is true:  a) the child process becomes defunct  b) the parent process becomes defunct  c) if the parent process does not handle SIGCHLD, the child process becomes a zombie  d) none of the above
36 Which signal is sent by the command "kill -9 "?  a) INT  b) TERM  c) KILL  d) STOP
37 Which command can be executed by a user who is already logged into the system, in order to change to the root user? (type the command without any parameters)  a) su  b) root  c) chroot  d) user
38 Which command is used to bring the background process to forground?  a) bg  b) fg  c) background  d) forground
39 User's Primary Group id is listed in which file, at the time of creation of the user (On a standard Unix system):  a) /etc/passwd  b) /etc/groups  c) /etc/login  d) /etc/profile
40 A user can change the default log-in shell using:  a) chmod  b) chsh  c) rmsh  d) tchsh
41 Process information in the current shell can be obtained by using:  a) kill  b) bg  c) fg  d) ps
42 If a program executing in background attempts to read from STDIN:  a) It is terminated  b) It's execution is suspended  c) STDIN is made available to it  d) None of the mentioned
43 Which of the following identifiers associated with a process decide its privilege level:  a) uid  b) suid  c) euid  d) gid
44 How to run a process in the background?  a) &  b) *  c) ?  d) |
45 The encrypted password of a user is stored in:  a) /etc/shadow  b) /etc/enpasswwd  c) /etc/.passwd  d) /etc/passwd
46 User id 0 is:  a) An invalid user id  b) The id of the root user  c) The id of a user when the user's account is deleted  d) None of the above
47 The /etc/passwd file doesn't contain:  a) userid  b) home directory for a user  c) login shell name  d) None of the above
48 What does the following command do?  who | wc -l    a) List the number of users logged in  b) List the users  c) List the number of users in the system  d) Display the content of who command
49 The login shell is:  a) The shell program that runs when the user logs in  b) The shell program that authenticates the user while logging in  c) Common shell for all the users that belong to the same group  d) None of the above
50 By default, a Linux user falls under which group?  a) staff  b) others  c) same as userid (UPG)  d) system
51 Which of the following command can be used to change the user password?  a) User can't change the password  b) passwd  c) passd  d) pwd
52 What is a context switch?  a) Kernel switches from executing one process to another.  b) Process switches from kernel mode to user mode.  c) Process switches from user mode to kernel mode.  d) None of the above
53 What is the default maximum number of processes that can exist in Linux?  a) 32768          b) 1024                   c) 4096          d) unlimited
54 Which of the following files need to be referred for user's secondary group?  a) /etc/passwd  b) /etc/shadow  c) /etc/group  d) /etc/profile
55 How do you get parent process identification number?  a) waitpid  b) getpid()  c) getppid()  d) parentid()
56 Pid of init process:  a) 0   b) 1  c) 32767  d) none of the above
57 Return value of fork() system call can be:  a) -1,<0,0   b) -1,>0,0
58 How many times printf() will be executed in the below mentioned program?        main() {          int i;            for (i = 0; i < 4; i++)          fork();                printf("my pid = %dn", getpid());      }    a) 4  b) 8  c) 16  d) 32
59 What is output of the following program?            int main() {          fork();          fork();          fork();          if (wait(0) == -1)              printf("leaf childn");      }    a) "leaf child" will be printed 1 times  b) "leaf child" will be printed 3 times  c) "leaf child" will be printed 4 times  d) "leaf child" will be printed 8 times
60 What is the output of the below code?        void exit_handler1();      void exit_handler2();      int main() {          int pid;          atexit(exit_handler1);          atexit(exit_handler2);          pid = fork();          if(pid == 0) {             _exit(0);          } else {              sleep(2);              exit(0);          }          return 0;      }    a) Only child executes the exit_handler 1 and 2.  b) Only parent executes the exit_handler 1 and 2.  c) Both parent and child executes the exit_handler 1 and 2.  d) Neither parent nor child executes the exit_handler 1 and 2.
61 The maximum time slice that can be given to a process in Linux (where tick is 10ms) is:  a) 150ms     b) 10ms      c) 300 ms      d) 600ms
62 Which niceness value among the following indicate most favorable scheduling?  a) 0  b) 19  c) 5  d) -20
63 The process which terminates before the parent process exits becomes:  a) Zombie  b) Orphan  c) Child  d) None of the above
64 Fork returns _____ to parent process on success:  a) 0    b) child process id   c) parent process id   d) none
65 Nice can be used by an ordinary process to:  a) increase the priority of a process  b) decrease the priority of a process  c) increase or decrease the priority of a process
66 In Linux kernel-2.6 Real time priority ranges from:  a) 0 to 99  b) 0 to 139  c) -20 to 19  d) 100 to 139
67 Solaris system class priority is:  a) 0-59  b) 60-99  c) 100-159  d) 160-169
68 Solaris real time class priority is:  a) 0-59  b) 60-99  c) 100-159  d) 160-169
69 On x86-32 Linux, at which address the code segment of the program starts?  a) 0×00000000  b) 0×08048000  c) 0×80000000  d) 0xbfff0000
70 A system has 512MB of physical memory. Which among the following is not a suitable virtual memory size for this system architecture?   a) 512MB  b) 256M  c) 4GB  d) None of the above
71 LRU stands for:  a) Last received Unit        b) Least recently Used  c) Least recently usable     d) Lost Recoverd unit
72 Mm_struct maintains?  a) memory files  b) open files  c) pipe  d) active memory regions
73 Which system call can be used by a user process to lock a memory so that it cannot be swapped out?
74 Is page table per process entity?  a) Yes  b) No
75 On x86-32 Linux, at which address the user stack resides normally?  a) 0×00000000  b) 0x3fff0000  c) 0x7fff0000  d) 0xbfff0000
76 Describe the use of strace command
77 Among these files which has an ELF format:  a) shared objects  b) core  c) executables  d) all of the above
78 Which one can be a real time schedule policy?  a) SCHED_FIFO  b) SCHED_SPF  c) SCHED_OTHER  d) SCHED_FILO
79 Each process has unique:  a) fd table  b) file table  c) inode table  d) data block table
80 File descriptor table indexes which kernel structure?  a) struct file  b) strruct fs_struct  c) files_struct  d) struct inode
81 What is the default number of files open per user process?  a) 0  b) 1  c) 2  d) 3
82 Switch table is used by:  a) device special file  b) directory file  c) fifo  d) link file.
83 What is the use of fcntl function?  a) locking a file  b) reading the file descriptor flag  c) changing the file status flag  d) all the above
84 The file system information is stored in:  a) Boot block  b) Super Block  c) Inode Table  d) Data Block
85 Printf() uses which system call:  a) open  b) read  c) write  d) close
86 read() system call on success returns:  a) 0  b) -1  c) number of character  d) none
87 Which system call is used to create a hard link?  a) hard-link  b) link  c) symlink  d) ln
88 namei() is:  a) ANSI C library function  b) C library function  c) System call  d) kernel routine
89 dup2(1,0):  a) closes the stdout and copies the stdin descriptor to stdout  b) closes the stdin and copies the stdout descriptor to stdin  c) will produce compilation error  d) None of the above
90 If the fork() system call returns -1, then it means?  a) No new child process is created  b) The child process is an orphan  c) The child process is in Zombie
91 If one of the thread in multi-threaded process is blocked on an I/O, which of the following is true?  a) The entire process with block if their is no kernel supported threads  b) Other threads of the process will continue to execute even if there is no kernel supported threads  c) It depends on specific implementatation  d) All of the above
92 Which function can be used instead of the dup2 to duplicate the file descriptor?  a) read()  b) open()  c) stat()  d) fcntl()
93 Below is the code:    int main() {  int fd1, fd2;  struct stat buff1, buff2;  fd1 = open("1.txt", O_RDWR);  fd2 = open("2.txt", O_RDWR | O_APPEND);  lseek(fd1, 10000, SEEK_SET);  write(fd1, "abcdefghij", 10);  write(fd2, "abcdefghij", 10);  fstat(fd1, &buff1);  fstat(fd2, &buff2);  printf(" %d %d", buff1.st_size, buff2.st_size);  return 0;  }    Before running the program, the file 1.txt and 2.txt size is 20 each. What is the output?  a) 30 30  b) 100020 20  c) 100030 30  d) 100010 30
94 Given a code snippet below?    #define PERMS (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)  int main() {  int fd1, fd2;  umask(0);  fd1 = open("file1", O_CREAT | O_RDWR, PERMS)  umask(S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);  fd2 = open("file2", O_CREAT | O_RDWR, PERMS)  return 0;  }    The newly created files file1 and file2 will have the permissions respectively  a) rw-rw-rw- r---  b) r--- rw-rw-rw-  c) rw-rw-rw- rw---  d) None of the above
95 What is stored in logfile as per below mentioned code if we execute ./a.out > logfile?    int main() {  int fd;  close(1);  fd = open("logfile",O_RDWR, 0744);  write(fd, "Hello", 5);  printf("Worldn");  return 0;  }    a) Hello  b) HelloWorld  c) World  d) None
96 Code snippets    str1="45678n"  str2="123n"  f1 = fopen(file1,RDWR,RWX)  f2 = fopen(file1,RDWR,RWX)  write(f1,str1,len_str1)  write(f2,str2,len_str2)    o/p:    a) 12378  b) 123(newline)8(newline)  c) 123(newline)78(newline)  d) 45678(newline)123(newline)
97 Code snippet (file1 size is 2024)    f1 = fopen (file1, RDWR, RWX)  lseek(f1,1024,SEEK_SET)  write(f1,buf,10)  What is offset now.    a) 1024  b) 1034  c) 2034  d) 2054
98 Code snippets    str1="45678n"  str2="123n"  f1 = fopen(file1,RDWR,RWX)  f2 = dup(f1)  write(f1,str1,len_str1)  write(f2,str2,len_str2)    o/p:    a) 12378  b) 123(newline)8(newline)  c) 123(newline)78(newline)  d) 45678(newline)123(newline)
99 For the below mentioned code:    int main() {  int fd;  fd = open("logfile", O_CREAT|O_RDWR, 0600);  lseek(fd, 5, SEEK_CUR);  write(fd, "Hello", 5);  return 0;  }    What is the logfile size now if it's initially was 1024 bytes?    a) 5  b) 1024  c) 1029  d) 1034

Download Linux Operating System Management Interview Questions And Answers PDF


Online Web Tutorials And Interview Questions With Answers Forum:
https://globalguideline.com/forum/

2015-02-19 05:24:52

Advertisement
Ads By Google

Re: Linux Operating System Management Interview Questions And Answers



\n

Board footer