Linux Flashcards
Question Bank
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
C
D: without warning. force
In linux, which command is used to show the name of the operating system.
A. os
B. unix
C. uname
D. osname
C
What shell’s wild-card is used to match any number of characters including none
A. *
B. ?
C. /
D. $
A
Which option of rm command is used to remove a directory with all its subdirectories
A. -b
B. -o
C. -r
D. -p
C
When a child process exits before the parent process exits, which of the following is true:
A. if the parent process does not handle SIGCHLD, the child process becomes a zombie
B. the parent process becomes defunct
C. the child process becomes defunct
D. none of the mentioned
A
Which one of the following is not correct?
A. in multi thread process thread details will not be available if the main thread is already terminated
B. proc filesystem does not contain any directory for thread in the process
C. proc filesystem contain any directory
D. none of the mentioned
B
What is correct regarding the below command in linux?
ln -s <existing_source> <optional_link></optional_link></existing_source>
A. It creates a softlink for the existing source file.
B. It creates a hardlink for the existing source file.
C. It is not part of linux and gives errors.
D. It creates a direct and fast link to the existing source file
A
What do the below commands do in linux?
fdisk -l
A. Gives the count of empty partitions of the disk.
B. Identifies the partitions of the disk.
C. Gives the count of non - empty partitions of the disk.
D. Gives list of sectors present on the disk.
B
Which one of the following commands is not used to check disk space usage?
A. df
B. du
C. dn
D. ncdu
C
You have a file named secret.txt with the following permissions: -rw-r–r–. Who can read the file contents?
A. Only the owner of the file.
B. The owner and the group that owns the file.
C. Anyone on the system.
D. Everyone except the owner and the group that owns the file.
B
You are currently in the /home/user directory and want to move to the /etc directory. Which command would you use?
A. mv /home/user/etc
B. pwd /etc
C. cd /etc
D. Is /etc
C
You are running a program that is consuming too much system resources and needs to be terminated. What command would you use to find its process ID (PID)?
A. ps-aux
B. top
C. killall
D. free
A
You are managing a server with multiple users. You want to grant user webuser read and execute access to the file /var/www/index.html, but not write access. Which command should you use?
A. chmod 444 /var/www/index.html
B. chown webuser:webgroup /var/www/index.html
C. chgrp webgroup /var/www/index.html
D. sudo rm -rf /var/www/index.html
A
You are working in the directory /home/user/documents/projects/project1/data/ and want to quickly move to the parent directory of data. Which command would be most efficient?
A. cd ../../../
B. cd ..
C. cd ~
D. cd /home/user/documents/projects/project1/
B
You notice a process called myscript.py consuming too much CPU resources and want to terminate it. You have its PID (process ID) from a system monitor. Which command should you use?
A. ps -f | grep myscript.py
B. kill <PID>
C. top
D. reboot</PID>
B