R4RIN
Articles
Java 8
MCQS
Unix/Lunux MCQ Quiz Hub
Linux Mcqs Questions Set 2
Choose a topic to test your knowledge and improve your Unix/Lunux skills
1. Which command is used to display all the files including hidden files in your current and its subdirectories ?
ls –aR
ls –a
ls –R
Is –l
2. Which of the following commands can be used to copy files across systems?
ssh
telnet
rsh
ftp
3. pwd command displays
user password
password file content
present working directory
none of the mentioned
4. Which of the following commands can be used to change default permissions for files and directories at the time of creation
Chmod
Chown
Umask
Chgrp
5. Which tar command option is used to list the files in a tape archive format?
cvf
tvf
xvf
ovf
6. Which of the following commands will allow the user to search contents of a file for a particular pattern
touch
grep
find
ls
7. Write the command to display the current date in the form dd/mm/yyyy.
date +%d/%m/%Y
date +”%d/%m/%Y”
date +/%d/%m/20%y
date +”/%d/%m/20%y”
8. The command syntax to display the file sample.txt one page at a time is
man sample.txt>more
cat sample.txt<more
cat sample.txt|more
none of the mentioned
9. Which one shows the name of the operating system?
uname -n
uname -r
uname -o
uname –m
10. How do you add (append) a file file1 to the example.tar file
no you cannot add a file to example.tar
tar -cvf example.tar file1
tar -rvf file1 example.tar
tar -evf file1 example.tar
11. How to execute ls command inside a vi editor?
!ls
ls
:!ls
we can’t execute
12. Which command gives the first byte where the difference is in the file1 & file2?
diff
cmp
comm
ls -a
13. To open a file file1 with cursor at line number 4
vi +num file1
vi +set num file1
vi + set num file1
vi +/se nu file1
14. sed is a command typically used for
Perform complex calculations
Perform FIFO based non-blocking I/O
Modify/print selective contents of a file
None of the mentioned
15. What communication command provides communication to another user logged on by writing to the bottom of their terminal?
talk
write
chat
transmit
16. Which screen manipulation command sets the screen back to normal?
tput cup
tput smso
tput rmso
tput blink
17. Which command will you use to see the available routes?
show route
route status
netstat -r
none of the mentioned
18. Which of the following time stamps need not exist for a file on traditional unix file system
Access Time
Modification Time
Creation Time
Change Time
19. Which command is used to set limits on file size
fsize
flimit
ulimit
usize
20. Which option of rmdir command will remove all directories a, b, c if path is a/b/c
–b
–o
–p
–t
21. Which represents the user home directory
/
.
..
~
22. If a file is removed in Unix using rm then
The file can be recovered by a normal user
The file cannot be recovered by a user
The file can be fully recovered provided the sytem is not rebooted
The file will be moved to /lost+found directory and can be recovered only by administrator’s intervention
23. Executing the cd .. command when at the root level causes
Error message indicating the user cant access beyond the root level
Behavior is unix-flavor dependent
Results in changing to the home directory
Nothing happens
24. How do you rename file new to file old ?
mv new old
move new old
cp new old
rn new old
25. What command is used to copy files and directories?
copy
cp
rn
cpy
26. When mv f1 f2 is executed which files inode is freed?
f1
f2
new inode will be used
no inode is freed
27. Any files attribute information is stored in which structure on the disk
Inode
Data blocks
File blocks
Directory file
28. When you use the ln command, which of the following occurs?
a file is created that points to an existing file
a file is created that is a copy of an existing file
a file is moved from one location to another
a file is renamed
29. srwxr-xrw- is a
internet socket file
unix domain socket file
symbolic link
shared file
30. Binary or executable files are:
Regular files
Device files
Special files
Directory files
31. The directory file contains:
File names & File Sizes
File names & Inode Numbers
File names & Address
File names & Permissions
32. Which directory contain device special files?
/etc
/etc/dev
/root/bin
/dev
33. Which of the following is not a valid file type on Linux
Socket
Softlink
Inode
FIFO
34. Which of the following is not correct statement regarding file types?
Hard links share same inode number
Soft links cannot be created across partitions
Socket files are Unix domain sockets
Character file is a special file
35. Which are the two types of device files?
Character & Block
Character & Socket
Block & FIFO
Input & output
36. Which is an example for character special file?
Hard disk
CD-ROM
Terminal
Memory
37. Which is an example for block special file?
Virtual Terminal
CD-ROM
Terminal
Serial modem
38. All device files are stored in which directory?
/etc
/bin
/dev
/usr
39. The file permission 764 means:
Every one can read, group can execute only and the owner can read and write
Every one can read and write, but owner alone can execute
Every one can read, group including owner can write, owner alone can execute
Every one can read and write and execute
40. The permission -rwxr–r– represented in octal expression will be
777
666
744
711
41. Effective user id can be set using following permission
0777
2666
4744
1711
42. Effective group id can be set using following permission
0777
2666
4744
1711
43. Sticky bit can be set using following permission
777
2666
4744
1711
44. The permission -rwSr–r– represented in octal expression will be
0777
2666
4744
4644
45. The permission -rwxr-sr– represented in octal expression will be
0777
2766
2744
2754
46. If user tries to remove (rm) a readonly file (444 permission), what will happen?
The file is removed successfully (and silently)
The rm command prompts for a confirmation, the command is successful upon confirmation
The rm command prompts for a confirmation, however the operation fails because of insufficient permissions
The rm command fails because of insufficient permissions
47. A user does a chmod operation on a file. Which of the following is true?
The last accessed time of the file is updated
The last modification time of the file is updated
The last change time of the file is updated
None of the mentioned
48. If the umask value is 0002. what will be the permissions of new directory
777
775
774
664
49. What is the command to set the execute permissions to all the files and subdirectories within the directory /home/user1/direct
chmod –r +x /home/user1/direct
chmod –R +x /home/user1/direct
chmod –f –r +x /home/user1/direct
chmod –F +x /home/user1/direct
50. The permission -rwxr-xr-t represented in octal expression will be
777
1755
1754
2754
Submit