List Of Makefile Interview Questions
Q – 1 If make command is executed as “make -j 2?, then:
a) two jobs will run simultaneously
b) only two will be executed
c) it will give an error
d) none of the mentioned?
Ans- a) two jobs will run simultaneously
Q – 2 What is makefile?
a) makefile describes to the make command that how to compile the program
b) makefile contains various statements related with the compilation of target
c) both (a) and (b)
d) none of the mentioned?
Ans- a) makefile describes to the make command that how to compile the program
Q – 3 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?
a) chmod 046 textfile
b) chmod 640 textfile
c) chmod 310 textfile
d) chmod rw r nil textfile?
Ans- b) chmod 640 textfile
Q – 4 Binary or executable files are:
a) regular files
b) device files
c) special files
d) directory files?
Ans- a) Regular files
Q – 5 Which of the following umask settings doesn’t allow execute permission to be set by default on directory files?
a) 222
b) 111
c) 000
d) 444
Ans- c) 000
Q – 6 Which of the following umask settings allow execute permission to be set by default on regular files?
a) 222
b) 111
c) 000
d) None of the given choices
Ans- d) None of the given choices
Q – 7 The command chmod 4777 a.out:
a) will set the suid bit of a.out
b) will set the suid bit of a.out only if the command is issued by root
c) is not a valid command
d) will set the sticky bit of a.out
Ans- a) will set the suid bit of a.out
Q – 8 What does chmod +t do?
a) wrong syntax
b) set effective userid for filename
c) set effective groupid for filename
d) set the sticky bit
Ans- d) set the sticky bit
Q – 9 A user executes the following command successfully:
$ chmod +x file1.txt
Which of the following is true of the output of this command?
a) The command results in adding execute permission to the user who ran this command
b) The command results in adding execute permission for the owner of the file
c) The command results in an error since the file is not an executable file
d) The command results in adding execute permission for all users (i.e., user,group & others)
Ans- d) The command results in adding execute permission for all users (i.e., user,group & others)
Q – 10 If you are a root user, how can you grand execute permission only for the owner of the file project1?
a. chmod +x project1
b. chmod u+x project1
c. chmod a+x project1
d. chmod U+X project1
Ans- b. chmod u+x project1
Q – 11 Which command is used to assign read-write permission to the owner?
a) chmod a+r file
b) chmod o+r file
c) chmod u=rw file
d) chmod og-r file
Ans- c) chmod u=rw file
Q – 12 Which make command option ignores all errors in commands executed to remark files?
a) -i
b) -j
c) -k
d) -l
Ans- a) -i
Q – 13 Given the command:
$ chmod o-w datafile
a) sets write permission to everyone for datafile
b) sets write permission to others for datafile
c) clears write permission to everyone for datafile
d) clears write permission to others for datafile
Ans- d) clears write permission to others for datafile
Q – 14 With a umask value of 112, what is the default permission assigned to newly created regular file?
a) -x-x-wx
b) -rw-rw-r-
c) -r-xr-x-r-
d) -rw-rw-r-
Ans- d) -rw-rw-r-
Q – 15 The permission -rwxr-xr-t represented in octal expression will be:
a) 0777
b) 1755
c) 1754
d) 2754
Ans- b) 1755
Q – 16 As we type “make” command on the terminal:
a) make reads the makefile in the current directory
b) make reads the makefile in the parent directory
c) make reads the makefile in the predefined environment variable
d) none of the mentioned
Ans- a) make reads the makefile in the current directory
Q – 17 If we want to get the exit status that specified targets are up to date or not, we have to execute the make command with option:
a) -q
b) -r
c) -s
d) -t
Ans- a) -q
Q – 18 Which option of make command print the commands that would be executed, but do not execute them?
a) -m
b) -n
c) -o
c) -p
Ans- b) -n
Q – 19 If our makefile is named as “google”, then which one of the following command will compile the code with this makefile:
a) make -a google
b) make -f google
c) make sanfoudry
d) make
Ans- b) make -f google
Q – 20 The command “make google” will:
a) create the executable if google.c file is present in the current directory
b) create the object file named as google.o
c) give an error
d) none of the mentioned
Ans- a) create the executable if google.c file is present in the current directory
Q – 21 The makefile starts executing from:
a) first target
b) first target whose name starts with “.”
c) first target whose name does not starts with “.”
d) none of the mentioned
Ans- c) first target whose name does not starts with “.”
Q – 22 What is phony target in the makefile?
a) the target which is not a filename
b) the target which is a filename
c) the target which does not used for compilation
d) none of the mentioned
Ans- a) the target which is not a filename
Q – 24 When a target of makefile fails to execute:
a) make does not executes any other target dependent on it
b) it returns a status
c) both (a) and (b)
d) none of the mentioned
Ans- c) both (a) and (b)
Q – 25 Which one of the following is not a valid makefile directive?
a) if
b) elif
c) endif
d) none of the mentioned
Ans- d) none of the mentioned
Q – 26 Macros for the make-file can be defined in:
a) makefile
b) command line
c) both (a) and (b)
d) none of the mentioned
Ans- c) both (a) and (b)
Q – 27 Which one of the following can be used to specify the directory to search the dependencies and target files?
a) VPATH
b) CPATH
c) FPATH
d) none of the mentioned
Ans- a) VPATH
Q – 28 Running “make” command without the arguments starts the target ____ in the makefile.
a) “.phony”
b) “clean”
c) first
d) none of the mentioned
Ans- c) first
Q – 29 If the umask value is 0002. What will be the permissions of new directory:
a) 777
b) 775
c) 774
d) 664
Ans- b) 775
Q – 30 If we want to execute the make-file by just giving the “make” command, make-file should be named as:
a) Make-file
b) makefile
c) MAKEFILE
d) none of the mentioned
Ans- a) Makefile
Q – 31 The permission -rwxr-sr- represented in octal expression will be:
a) 0777
b) 2766
c) 2744
d) 2754
Ans- d) 2754
Q – 32 A user does a chmod operation on a file. Which of the following is true?
a) The last accessed time of the file is updated
b) The last modification time of the file is updated
c) The last change time of the file is updated
d) None of the above
Ans- c) The last change time of the file is updated
Q – 33 Sticky bit can be set using following permission:
a) 0777
b) 2666
c) 4744
d) 1711
Ans- d) 1711
Q – 34 What is the command to set the execute permissions to all the files and sub-directories within the directory /home/user1/direct:
a) chmod -r +x /home/user1/direct
b) chmod -R +x /home/user1/direct
c) chmod -f -r +x /home/user1/direct
d) chmod -F +x /home/user1/direct
Ans- b) chmod -R +x /home/user1/direct
Q – 35 If user tries to remove (rm) a readonly file (444 permission), what will happen?
a) The file is removed successfully (and silently)
b) The rm command prompts for a confirmation, the command is successful upon confirmation
c) The rm command prompts for a confirmation, however the operation fails because of insufficient permissions
d) The rm command fails because of insufficient permissions
Ans- b) The rm command prompts for a confirmation, the command is successful upon confirmation
Q – 36 The permission -rwSr-r- represented in octal expression will be:
a) 0777
b) 2666
c) 4744
d) 4644
Ans- d) 4644
Q – 37 Effective group id can be set using following permission:
a) 0777
b) 2666
c) 4744
d) 1711
Ans- b) 2666
Q – 38 Effective user id can be set using following permission:
a) 0777
b) 2666
c) 4744
d) 1711
Ans- c) 4744
Q – 39 The file permission 764 means:
a) Every one can read, group can execute only and the owner can read and write
b) Every one can read and write, but owner alone can execute
c) Every one can read, group including owner can write, owner alone can execute
d) Every one can read and write and execute
Ans- c) Every one can read, group including owner can write, owner alone can execute
Q – 40 The permission -rwxr-r- represented in octal expression will be:
a) 777
b) 666
c) 744
d) 711
Ans- c) 744
Q – 41 srwxr-xrw- is a:
a) internet socket file
b) unix domain socket file
c) symbolic link
d) shared file
Ans- b) unix domain socket file
Q – 42 The soft link will increase the link counter of the file (T/F):
a) True
b) False
Ans- b) False
Q – 43 When you use the ln command, which of the following occurs?
a) a file is created that points to an existing file
b) a file is created that is a copy of an existing file
c) a file is moved from one location to another
d) a file is renamed
Ans- a) a file is created that points to an existing file
Q – 44 The directory file contains:
a) File names & File Sizes
b) File names & Inode Numbers
c) File names & Address
d) File names & Permissions
Ans- b) File names & Inode Numbers
Q – 45 Which of the following is not a valid file type on Linux?
a) Socket
b) Soft-link
c) Inode
d) FIFO
Ans- c) Inode
Q – 46 Which directory contain device special files?
a /etc
b) /etc/dev
c) /root/bin
d) /dev
Ans- d) /dev
Q – 47 Which are the two types of device files?
a) Character & Block
b) Character & Socket
c) Block & FIFO
d) Input & output
Ans- a) Character & Block
Q – 48 Which is an example for block special file?
a) Virtual Terminal
b) CD-ROM
c) Terminal
d) Serial modem
Ans- b) CD-ROM
Q – 49 Which of the following is not correct statement regarding file types?
a) Hard links share same inode number
b) Soft links cannot be created across partitions
c) Socket files are Unix domain sockets
d) Character file is a special file
Ans- b) Soft links cannot be created across partitions
Q – 50 Which is an example for character special file?
a) Hard disk
b) CD-ROM
c) Terminal
d) Memory
Ans- c) Terminal
Q – 51 All device files are stored in which directory?
a) /etc
b) /bin
c) /dev
d) /usr
Ans- c) /dev