Red Hat RHCSA UPDATED ACTUAL Exam Questions and
CORRECT Answers
What is VDO? - (ANSWERS)VDO provides inline data reduction for Linux in the!@#$%%%%%
form of
%%%%%%
Deduplication
Compression
Thin provisioning
Installing VDO - (ANSWERS)Yum install lvm2 kmod-kvdo vdo
Create your partition using fdisk.
Create physical volume.
Pvcreate /dev/nvme0n3 ( run as root)
Create volume group.
Vgcreate vg1 /dev/nvme0n3
Create logical volume with ado parameters.
Lvcreate —type vdo —name vdo1 —size 5gb —virtualize 50gb vg1
Create file system
Mkfs.xfs -k /dev/vg1/vdo1
Create mount point for vdo
Mkdir /vdo_m
Vim /etc/fstab
/dev/vg1/vdo1 /vdo_m xfs defaults 0 0
Mount -a
Variable - (ANSWERS)Variable is nothing more than a label
It can hold some value
Var1 = 20
Chmod u+x variable.sh
Vim variable.sh
#!/bin/bash
Var1=20
Echo"the value of the variable is $var1"
Echo"the value of the variable without using the dollar sign var1"
Variable - (ANSWERS)vim variables1.sh
Chmod u+x variable1.sh
Var1 = 20
Var2 = baljit
Var3 = "ballot singh"
Var4 = 20.4
Var5 = 3+3
Echo $var1
Echo $var2
Echo $var3
,Red Hat RHCSA UPDATED ACTUAL Exam Questions and
CORRECT Answers
Echo $var4 !@#$%%%%%
Echo $var5 %%%%%%
./variable1.sh
Variable - (ANSWERS)vim variable3.sh
Echo" the home directory of the user is $home"
Echo" the default shell $shell"
Chmod u+x variable3.sh
Variable - (ANSWERS)vim variable4.sh
Chmod u+x variable4.sh
#!/bin/bash
Echo"Enter the name of a file"
Read name
Touch $name
Echo "File created"
Write a shell script to create two directories. The name of the directories will be passed by the
user. - (ANSWERS)vim variable5.sh
Chmod u+x variable5.sh
#!/bin/bash
Echo" Enter the two directory names"
Read dir1 dir2
Mkdir $dir1 $dir2
Echo " Files created "
Write script to change the name of a file. Ask from the user, the old file name and the new file
name - (ANSWERS)vim variable6.sh
Chmod u+x variable6.sh
#Write script to change the name of a file. Ask from the user, the old file name and the new file
name
Echo"Enter name of file"
Read file1
Read file2
Mv $file1 $file2
Echo "file name altered"
Arguments (shell scripting) - (ANSWERS)chmod u+x argument.sh
#!/bin/bash
Touch $1 $2
Echo "Files created"
, Red Hat RHCSA UPDATED ACTUAL Exam Questions and
CORRECT Answers
Echo " total arguments passed are: $# " !@#$%%%%%
Echo "Each argument value is: $*" %%%%%%
Arguments2 (shell scripting) - (ANSWERS)vim arg.sh
#!/bin/bash
Mv $1 $2
Echo"Name updated"
Chmod u+x arg.sh
./arg.sh 11 111
If - else - (ANSWERS)if [ condition ]
Then
Statement 1
Statement 2
...
Statement n
Else
Statement 1
Statement 2
...
Statement n
Fi
If - else 2
Q. Check if the numbers entered by the user is greater than 10 - (ANSWERS)vim if_else.sh
Chmod u+x if_else.sh
#!/bin/bash
Echo"Enter the number"
Read number
If [ $number -gt 10]
Then
Echo"Well done"
Else
Echo"number is small"
Fi
Arithmetic Comparison - (ANSWERS)Equal to exp1 -eq exp2
Not equal to exp1 -ne exp2
Greater than exp1 -gt exp2
Greater than or equal to exp1 -ge exp2
Less than exp1 -lt exp2
Less than or equal to exp1 -le exp2
CORRECT Answers
What is VDO? - (ANSWERS)VDO provides inline data reduction for Linux in the!@#$%%%%%
form of
%%%%%%
Deduplication
Compression
Thin provisioning
Installing VDO - (ANSWERS)Yum install lvm2 kmod-kvdo vdo
Create your partition using fdisk.
Create physical volume.
Pvcreate /dev/nvme0n3 ( run as root)
Create volume group.
Vgcreate vg1 /dev/nvme0n3
Create logical volume with ado parameters.
Lvcreate —type vdo —name vdo1 —size 5gb —virtualize 50gb vg1
Create file system
Mkfs.xfs -k /dev/vg1/vdo1
Create mount point for vdo
Mkdir /vdo_m
Vim /etc/fstab
/dev/vg1/vdo1 /vdo_m xfs defaults 0 0
Mount -a
Variable - (ANSWERS)Variable is nothing more than a label
It can hold some value
Var1 = 20
Chmod u+x variable.sh
Vim variable.sh
#!/bin/bash
Var1=20
Echo"the value of the variable is $var1"
Echo"the value of the variable without using the dollar sign var1"
Variable - (ANSWERS)vim variables1.sh
Chmod u+x variable1.sh
Var1 = 20
Var2 = baljit
Var3 = "ballot singh"
Var4 = 20.4
Var5 = 3+3
Echo $var1
Echo $var2
Echo $var3
,Red Hat RHCSA UPDATED ACTUAL Exam Questions and
CORRECT Answers
Echo $var4 !@#$%%%%%
Echo $var5 %%%%%%
./variable1.sh
Variable - (ANSWERS)vim variable3.sh
Echo" the home directory of the user is $home"
Echo" the default shell $shell"
Chmod u+x variable3.sh
Variable - (ANSWERS)vim variable4.sh
Chmod u+x variable4.sh
#!/bin/bash
Echo"Enter the name of a file"
Read name
Touch $name
Echo "File created"
Write a shell script to create two directories. The name of the directories will be passed by the
user. - (ANSWERS)vim variable5.sh
Chmod u+x variable5.sh
#!/bin/bash
Echo" Enter the two directory names"
Read dir1 dir2
Mkdir $dir1 $dir2
Echo " Files created "
Write script to change the name of a file. Ask from the user, the old file name and the new file
name - (ANSWERS)vim variable6.sh
Chmod u+x variable6.sh
#Write script to change the name of a file. Ask from the user, the old file name and the new file
name
Echo"Enter name of file"
Read file1
Read file2
Mv $file1 $file2
Echo "file name altered"
Arguments (shell scripting) - (ANSWERS)chmod u+x argument.sh
#!/bin/bash
Touch $1 $2
Echo "Files created"
, Red Hat RHCSA UPDATED ACTUAL Exam Questions and
CORRECT Answers
Echo " total arguments passed are: $# " !@#$%%%%%
Echo "Each argument value is: $*" %%%%%%
Arguments2 (shell scripting) - (ANSWERS)vim arg.sh
#!/bin/bash
Mv $1 $2
Echo"Name updated"
Chmod u+x arg.sh
./arg.sh 11 111
If - else - (ANSWERS)if [ condition ]
Then
Statement 1
Statement 2
...
Statement n
Else
Statement 1
Statement 2
...
Statement n
Fi
If - else 2
Q. Check if the numbers entered by the user is greater than 10 - (ANSWERS)vim if_else.sh
Chmod u+x if_else.sh
#!/bin/bash
Echo"Enter the number"
Read number
If [ $number -gt 10]
Then
Echo"Well done"
Else
Echo"number is small"
Fi
Arithmetic Comparison - (ANSWERS)Equal to exp1 -eq exp2
Not equal to exp1 -ne exp2
Greater than exp1 -gt exp2
Greater than or equal to exp1 -ge exp2
Less than exp1 -lt exp2
Less than or equal to exp1 -le exp2