Linux Questions & Answers on Linux Commands for Freshers– 2

https://www.computersprofessor.com/2018/07/linux-questions-answers-on-linux_6.html
1. Command used to determine the path of an executable file is
a) which
b) where
c) wexec
d) what
Answer: a
2. Command used to count number of character in a file is
a) grep
b) wc
c) count
d) cut
Answer: b
3. Which of these commands could you use to show one page of output at a time?
a) less
b) sed
c) pause
d) grep
Answer: a
4. Which commands will give you information about how much disk space each file in the current directory uses?
a) ls -l
b) ls -la
c) du
d) ls -a
Answer: c
5. Which of the following command output contains userid?
a) ls
b) help
c) date
d) ls –l
Answer: d
6. Which command is used to display all the files including hidden files in your current and its subdirectories ?
a) ls –aR
b) ls –a
c) ls –R
d) ls –l
Answer: a
7. Which of the following commands can be used to copy files across systems?
a) ssh
b) telnet
c) rsh
d) ftp
Answer: d
8. pwd command displays
a) user password
b) password file content
c) present working directory
d) none of the mentioned
Answer: c
9. Which of the following commands can be used to change default permissions for files and directories at the time of creation
a) Chmod
b) Chown
c) Umask
d) Chgrp
Answer: c
10. Which tar command option is used to list the files in a tape archive format?
a) cvf
b) tvf
c) xvf
d) ovf
Answer: b
11. Which of the following commands will allow the user to search contents of a file for a particular pattern
a) touch
b) grep
c) find
d) ls
Answer: b
12. Write the command to display the current date in the form dd/mm/yyyy.
a) date +%d/%m/%Y
b) date +”%d/%m/%Y”
c) date +/%d/%m/20%y
d) date +”/%d/%m/20%y”
Answer: a
13. The command syntax to display the file ‘sample.txt’ one page at a time is
a) man sample.txt>more
b) cat sample.txt
d) none of the mentioned
Answer: c
14. Which one shows the name of the operating system?
a) uname -n
b) uname -r
c) uname -o
d) uname –m
b) uname -r
c) uname -o
d) uname –m
Answer: c
15. How do you add (append) a file “file1” to the example.tar file
a) no you cannot add a file to example.tar
b) tar -cvf example.tar file1
c) tar -rvf file1 example.tar
d) tar -evf file1 example.tar
Answer: c
16. How to execute ls command inside a vi editor?
a) !ls
b) :ls
c) :!ls
d) we can’t execute
Answer: c
17. Which command gives the first byte where the difference is in the file1 & file2?
a) diff
b) cmp
c) comm
d) ls -a
Answer: b
18. To open a file file1 with cursor at line number 4
a) vi +num file1
b) vi +set num file1
c) vi + “set num” file1
d) vi +/se nu file1
Answer: a
19. sed is a command typically used for
a) Perform complex calculations
b) Perform FIFO based non-blocking I/O
c) Modify/print selective contents of a file
d) None of the mentioned
Answer: c
20. What communication command provides communication to another user logged on by writing to the bottom of their terminal?
a) talk
b) write
c) chat
d) transmit
Answer: a
21. Which screen manipulation command sets the screen back to normal?
a) tput cup
b) tput smso
c) tput rmso
d) tput blink
Answer: c
22. Which command will you use to see the available routes?
a) show route
b) route status
c) netstat -r
d) none of the mentioned
Answer: c