70 Linux Questions Part2
70 Linux Questions Part2
LINUX TUTORIAL
70 LINUX
QUESTIONS
Part - II
MCQ
Case study
Troubleshooting
Conceptual
True/False
Linux Basics
SSH File Permissions
Redirection Process
System Monitoring
Ques: 1
What is kernel?
Ques: 3
What is kernel?
The Linux kernel is the main component of a Linux OS and is the core interface
between a computer’s hardware and its processes.
Swap space in Linux is used when the amount of physical memory (RAM) is
full. If the system needs more memory resources and the RAM is full, inactive
pages in memory are moved to the swap space.
Ques: 5
Upgrade: performs the same action as “yum update”, but once finished
it also removes all of the obsolete packages from the system.
Ques: 10
Name default ports used for DNS, SMTP, FTP, SSH, DHCP and squid.
Ques: 10
DNS - 53
SMTP - 25
FTP - 21
SSH - 22
DHCP - 67,68
Squid - 3128
Http - 80
Https - 443
Ques: 11
ping -c 3 google.com
Ques: 13
/etc/group/
Ques: 14
$?
Ques: 15
cat /proc/cpuinfo
lscpu
Ques: 16
listusb
usbls
lsusb
getusb
Ques: 16
lsusb
Ques: 17
Which of the following environment variables is used as the default
argument for the "cd" command when no directory is provided?
PWD
HOME
PATH
USERPROFILE
Ques: 17
Which of the following environment variables is used as the default
argument for the "cd" command when no directory is provided?
PWD
HOME
PATH
USERPROFILE
Ques: 18
True or False. A command following a semicolon will be executed no matter the
exit status of the command that preceded the semicolon.
TRUE
Ques: 19
0-255
Ques: 20
/var/log/
Ques: 21
split -l 3 file_name
Ques: 24
vi file_name
i - for insert
ESC - to come out of insert mode
wq - to save
Ques: 26
ls -1 | wc -l
Ques: 30
Atd
Ques: 36
Which command syntax is correct if you want to assign
read only permission to everyone and
write permission to the owner of the file?
env or printenv
Ques: 43
What are the different ways to set environment variables?
Ques: 43
What are the different ways to set environment variables?
At user level:
Temporary
Permanent
At global level
Ques: 44
How can you set environment variables in Linux?
Ques: 44
How can you set environment variables in Linux?
pidof httpd
Ques: 46
What is nice value of a process?
Ques: 47
How to check the nice value of a process?
Ques: 47
How to check the nice value of a process?
ps -l PID
Ques: 48
You want a process with a PID of 8675 to complete its task faster than the default
rate. Which command should you run to accomplish this goal?
Ques: 48
You want a process with a PID of 8675 to complete its task faster than the default
rate. Which command should you run to accomplish this goal?
top command
Ques: 50
If you want to run a task/script in background even if you
close your terminal, what is the way?
Ques: 51
How to see all the active jobs?
Ques: 51
How to see all the active jobs?
jobs
Ques: 52
How to resume a stopped job in background or foreground?
Ques: 52
How to resume a stopped job in background or foreground?
bg
fg
Ques: 53
Which command displays information about kernel-related messages along with
hardware and system startup messages stored in kernel ring buffer?
Ques: 53
Which command displays information about kernel-related messages along with
hardware and system startup messages stored in kernel ring buffer?
dmesg
Ques: 54
In a directory you have a combination of files like xml, yml, scripts, logs etc,
how you will get/see only xml files?
Ques: 54
In a directory you have a combination of files like xml, yml, scripts, logs etc,
how you will get/see only xml files?
ls -l *.xml
Ques: 55
Create 100 files with naming file1, file2 file3... file100.
Ques: 55
Create 100 files with naming file1, file2 file3... file100.
touch file{1..100}
Ques: 56
How would you display all the files in the present working
directory that start with either the letter "c" or "m"?
Ques: 56
How would you display all the files in the present working
directory that start with either the letter "c" or "m"?
ls [cm]*
Ques: 57
Run a command that shows all the lines except any lines starting
with the a character # in a file?
Ques: 57
Run a command that shows all the lines except any lines starting
with the a character # in a file?
ls -1 | grep -i ^a
ls -1 | grep -v ^a
ls -1 | grep -e ^a
ls -1 | grep -x ^a
Ques: 58
Which of the following commands lists all files and
directories except those beginning with the letter "e"?
ls -1 | grep -v ^a
Ques: 59
Which of the following Bash commands produces the output of
"bat bet bit bot"?
echo b{ae}t
echo b{a,e,i,o}t
echo b[a,e,i,o]t
echo b[aeio]t
Ques: 59
Which of the following Bash commands produces the output of
"bat bet bit bot"?
echo b{ae}t
echo b{a,e,i,o}t
echo b[a,e,i,o]t
echo b[aeio]t
Ques: 60
What is a VM?
Ques: 60
What is a VM?
lv
lvs
vls
vl
Ques: 64
Which command can you use to display a list of currently
configured Physical Volumes?
lvs
or sudo lvs (as it required root access)
Ques: 65
Which command can you use to display a list of currently
configured Volume Groups?
vg
vgs
lvg
vgl
Ques: 65
Which command can you use to display a list of currently
configured Volume Groups?
vg
vgs
lvg
vgl
Ques: 66
Which command displays memory usage, including the amount
of swap space being used?
Ques: 66
Which command displays memory usage, including the amount
of swap space being used?
free command
Ques: 67
The /home partition is running out of disk space. Which
command can you use to determine which user's home
directory is using the most space?
Ques: 67
The /home partition is running out of disk space. Which
command can you use to determine which user's home
directory is using the most space?
You suspect a firewall is blocking inbound SSH attempts, and you contact the
networking team to investigate.
Assuming SSH is using the default port, which port number do you provide to
the networking team to investigate?
Ques: 68
A user reports that they are receiving a "Connection timed out" error when
attempting to SSH into a Linux server you support.
You suspect a firewall is blocking inbound SSH attempts, and you contact the
networking team to investigate.
Assuming SSH is using the default port, which port number do you provide to
the networking team to investigate?
Answer: 22
Ques: 69
What is Linux FileSystem?
Ques: 70
How to check your Linux FileSystem?
Ques: 70
How to check your Linux FileSystem?
lsblk -f