1. -s is a …………. that is used in a Linux shell.
A) Command
B) Parameter
C) Option argument
D) Both B and C
2. …………… is a Linux command that lists the contents in the current directory.
A) li
B) ls
C) lc
D) ld
3. Which of the following is the syntax of the command prompt used in a Linux shell?
A) root@hostname:~#
B) user>
C) Both A and B
D) None of the above
4. The symbol …….. used in a command prompt means that you are in your home directory.
A) #
B) $
C) >
D) ~
5. The symbol …….. used in a command prompt means you have logged in using a normal user account with limited rights.
A) #
B) $
C) >
D) ~
6. The symbol …….. used in a command prompt means you have logged in using a super user account with root user rights.
A) #
B) $
C) >
D) ~
7. ……. is a Linux command that displays the current username.
A) Display
B) Showuser
C) Whoami
D) Currentuser
8. The Linux command ……… is used to print the working directory.
A) print
B) pwd
C) pd
D) prinwd
9. The Linux command ……… is used to change the user password.
A) passwd
B) chpass
C) pwd
D) cpwd
10. ………… is the Linux command used to view the user details.
A) id
B) ud
C) vud
D) iud
11. The Linux command ………… list all files from your home directory including the hidden files.
A) ls -h
B) ls -a
C) li -a
D) li -h
12. ………… command creates the directory with the name “InfoTech”.
A) mkdir InfoTech
B) makedir InfoTech
C) md InfoTech
D) Both A and B
13. The command …………. change the current working directory to “InfoTech”.
A) cdir InfoTech
B) chdir InfoTech
C) cd InfoTech
D) md InfoTech
14. In Linux, which command returns you to your home directory?
A) cd
B) cd.
C) cd~
D) Both A and C
15. Which command is used to copy the contents of file1 to file2?
A) copy file1 file2
B) cp file1 file2
C) copy “file1” “file2”
D) cp “file1” “file2”
16. The ……….. command will copy the contents of directory1 as well as the directory itself to directory2.
A) cp directory1 directory2
B) cp directory2 directory1
C) cp -R directory1 directory2
D) cp -all directory1 directory2
17. What are the uses of the mv command in Linux?
i. It will move a file to a different directory.
ii. It will move multiple files to a different directory.
iii. It will rename a file or a directory.
A) i and ii only
B) i and iii only
C) ii and iii only
D) All i, ii and iii
18. The Linux command mv file1 InfoTech/file2 will ……
i. move the file named “file1” to the directory “InfoTech”.
ii. rename the “file1” to “file2”.
iii. move to file named “file1” to the directory InfoTech/file2
A) i and ii only
B) i and iii only
C) ii and iii only
D) All i, ii and iii
19. The Linux command ………. will delete an empty directory.
A) rm dir1
B) rmdir dir1
C) rmem dir1
D) rm -r dir1
20. The command ………. will recursively delete the files in the “InfoTech” directory.
A) rmr InfoTech
B) rm r InfoTech
C) rm -r InfoTech
D) rm -rf InfoTech
Answers:
- D) Both B and C
- B) ls
- C) Both A and B
- D) ~
- B) $
- A) #
- C) Whoami
- B) pwd
- A) passwd
- A) id
- B) ls -a
- A) mkdir InfoTech
- C) cd InfoTech
- D) Both A and C
- B) cp file1 file2
- C) cp -R directory1 directory2
- D) All i, ii and iii
- A) i and ii only
- B) rmdir dir1
- C) rm -r InfoTech
Comments are closed.