Linux Flashcards

Question Bank

1
Q

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

A

C

D: without warning. force

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

In linux, which command is used to show the name of the operating system.

A. os
B. unix
C. uname
D. osname

A

C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What shell’s wild-card is used to match any number of characters including none

A. *
B. ?
C. /
D. $

A

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which option of rm command is used to remove a directory with all its subdirectories

A. -b
B. -o
C. -r
D. -p

A

C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

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

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

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

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

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

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

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.

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Which one of the following commands is not used to check disk space usage?

A. df
B. du
C. dn
D. ncdu

A

C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

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.

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

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

A

C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

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

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

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

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

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/

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

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>

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly