1. The first thing that is searched when a command references a file is its
Correct : B. i node number
2. Profilers are
Correct : A. tools that analyze the run time behavior of a program
3. Which of the following tools can be used to keep track of evolving version of a file?
Correct : C. sccs
4. The size of any block in the unix file system is
Correct : D. any of the above
5. To find the block size on your file system the command is
Correct : D. cmchk
6. Each entry in inode table is of size
Correct : D. 64 bytes
7. The program contained in boot block, that loads kernel into memory is called
Correct : A. disk bootstrap program
8. The state of the file system is contained in
Correct : C. super block
9. Which file gets executed when we use the passwd command
Correct : C. /bin/passwd
10. The command cal j 1997 would give the output as
Correct : C. an error
11. To see the last access time of various files in a file system the command is
Correct : A. is-iu
12. To ascertain what are the contents of the file in your the system the best way would be
Correct : C. use the command file*
13. Which of these is not a command of Unix related with DOS
Correct : B. doscopy trial a:/
14. How many links are created when we creat a directory file?
Correct : B. 2
15. A user creates a link to a file file1 using the following command “ln file1 file2”. Which of the following is not true?
Correct : B. the number of links for file1 is displayed as 1
16. here are two hard links to the “file1″ say hl and h2 and a softlink sl. What happens if we deleted the “file1″?
Correct : A. we will still be able to access the file with hl and h2 but not with sl
17. If two files on same partition point to the same inode structure they are called
Correct : B. hard links
18. Deleting a soft-link
Correct : C. deletes just the softlink
19. Creation of hardlinks that point across partitions
Correct : D. is not allowed
20. Which command is used to change permissions of files and directories?
Correct : C. chmod
21. Where can I find the printer in the file structure?
Correct : B. /dev
22. Which of the following statement is true?
Correct : C. the mv command will preserve the meta data of the file
23. What UNIX command is used to update the modification time of a file?
Correct : D. touch
24. Which of the following time stamps need not exist for a file on traditional unix file system
Correct : C. creation time
25. Which command is used to set limits on file size
Correct : C. ulimit
26. Which option of rmdir command will remove all directories a, b, c if path is a/b/c
Correct : C. –p
27. Which represents the user home directory
Correct : D. ~
28. f a file is removed in Unix using ‘rm’ then
Correct : B. the file cannot be recovered by a user
29. Executing the ‘cd ..’ command when at the root level causes
Correct : D. nothing happens
30. How do you rename file “new” to file “old”?
Correct : A. mv new old
31. What command is used to copy files and directories?
Correct : B. cp
32. When mv f1 f2 is executed which file’s inode is freed?
Correct : B. f2
33. Any file’s attribute information is stored in which structure on the disk
Correct : A. inode
34. The file permission 764 means
Correct : C. every one can read, group including owner can write, owner
35. The permission -rwxr–r– represented in octal expression will be
Correct : C. 744
36. Effective user id can be set using following permission
Correct : C. 4744
37. Effective group id can be set using following permission
Correct : B. 2666
38. Sticky bit can be set using following permission
Correct : D. 1711
39. The permission -rwSr–r– represented in octal expression will be
Correct : D. 4644
40. The permission -rwxr-sr– represented in octal expression will be
Correct : D. 2754
41. f user tries to remove (rm) a readonly file (444 permission), what will happen?
Correct : B. the rm command prompts for a confirmation, the command is successful upon confirmation
42. A user does a chmod operation on a file. Which of the following is true?
Correct : C. the last change time of the file is updated
43. If the umask value is 0002. what will be the permissions of new directory
Correct : B. 775
44. What is the command to set the execute permissions to all the files and subdirectories within the directory
/home/user1/direct
Correct : B. chmod –r +x
/home/user1/direct
45. The permission -rwxr-xr-t represented in octal expression will be
Correct : B. 1755
46. With a umask value of 112, what is the default permission assigned to newly created regular file?
Correct : D. -rw-rw-r–
47. Which command is used to assign read- write permission to the owner?
Correct : C. chmod u=rw file
48. Given the command $ chmod o-w datafile
Correct : D. lears write permission to others for datafile
49. Which of these commands will set the permissions on file textfile to read and write for the owner, read for the group, and nothing for everyone else?
Correct : B. chmod 640 textfile
50. If you are a root user, how can you grand execute permission only for the owner of the file project1?
Correct : B. chmod u+x project1
51. A user executes the following command successfully:$ chmod +x file1.txt Which of the following is true of the output of this command?
Correct : D. the command results in adding execute permission for all users (i.e., user,group & others)
52. What does chmod +t do?
Correct : D. set the sticky bit
53. Which of the following umask settings doesn’t allow execute permission to be set by default on directory files
Correct : C. 0
54. Which of the following umask settings allow execute permission to be set by default on regular files
Correct : D. none of the given choices
55. The command chmod 4777 a.out
Correct : A. will set the suid bit of a.out
56. If a file is removed in Unix using ‘rm’ then
Correct : B. the file cannot be recovered by a user
57. When mv f1 f2 is executed which file’s inode is freed?
Correct : B. f2
58. . The file permission 764 means:
Correct : C. every one can read, group including owner can write, owner alone can execute
59. When you use the ln command, which of the following occurs?
Correct : A. a file is created that points to an existing file
60. srwxr-xrw- is a
Correct : B. unix domain socket file
61. Binary or executable files are:
Correct : A. regular files
62. The directory file contains
Correct : B. file names & inode numbers
63. Which directory contain device special files?
Correct : D. /dev
64. Which of the following is not a valid file type on Linux
Correct : C. inode
65. Which of the following is not correct statement regarding file types?
Correct : B. soft links cannot be created across partitions
66. Which are the two types of device files?
Correct : A. character & block
67. Which is an example for character special file?
Correct : C. terminal
68. Which is an example for block special file?
Correct : B. cd-rom
69. All device files are stored in which directory?
Correct : C. /dev
70. Which command is used to check filesystem usage in a system?
Correct : B. df
71. Which among the following allows fast file system recovery?
Correct : B. journaling
72. Which filesystem can be used to change certain kernel parameters at runtime using sysctl command?
Correct : D. procfs
73. Filesystem for CDROM is:
Correct : C. ext4
74. Which file system has journaling capability?
Correct : B. ext4
75. Which file contains the filesystems to be automatically mounted during boot?
Correct : B. /etc/fstab
76. which to mount the file system
Correct : C. mount-point
77. Which command is used to mount file system read only.
Correct : D. mount –r
78. Each process has unique
Correct : A. fd table
79. File descriptor table indexes which kernel structure?
Correct : A. struct file
80. What is the default number of files open per user process?
Correct : D. 3
81. he file system information is stored in
Correct : B. super block
82. Switch table is used by
Correct : A. device special file
83. What is the use of fcntl function?
Correct : D. all the above
84. Which function can be used instead of the dup2 to duplicate the file descriptor?
Correct : D. fcntl()
85. printf() uses which system call
Correct : C. write
86. read() system call on success returns
Correct : C. c)
87. Which system call is used to create a hard link?
Correct : B. link
88. namei() is
Correct : D. kernel routine
89. dup2(1,0)
Correct : B. closes the stdin and copies the stdout descriptor to stdin
90. What is stored in logfile as per below mentioned code if we execute ./a.out > logfile?nt main() {
int fd; close(1);
fd = open(“logfile”,O_RDWR, 0744); write(fd, “Hello”, 5); printf(“World\n”);
return 0;
}
Correct : B. helloworld
91. For the below mentioned codeint main() { int fd;
fd = open(“logfile”, O_CREAT|O_RDWR, 0600);
lseek(fd, 5, SEEK_CUR);
write(fd, “Hello”, 5);
return 0;
},
Correct : B. 1024
92. 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
Correct : C. rw-rw-rw- rw——
93. Below is the codeint 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?