wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Red Hat System Administrator 1

Total questions: 41

Worksheet time: 21mins

Name
Class
Date
1.

Which of the following commands will display the total size of the current directory in a human-readable format?

a)

ls -lh

b)

df -h

c)

du -sh

d)

stat .

2.

Which of the following commands can be used to change a user's password

a)

usermod -p

b)

passwd

c)

chgrp

d)

pwconv

3.

Which of the following is an example of sequentially running commands in Bash, where the second command only runs if the first succeeds?

a)

whoami ; ls -la

b)

whoami && ls -la

c)

whoami || ls-la

d)

whoami & ls -la

4.

Which of the following examples shows a second command executing only if the first command fails in Bash?

a)

cat aNewFile && touch aNewFile

b)

cat aNewFile ; touch aNewFile

c)

cat aNewFile || touch aNewFile

d)

cat aNewFile & touch aNewFile

5.

Which of the following symbols is used in Bash to continue a command onto a new line?

a)

;

b)

&&

c)

|

d)

\

6.

In Bash, which key combination performs a reverse search through your command history?

a)

Control + R

b)

Control + H

c)

Control + S

d)

Control + P

7.

In Bash, which of the following commands will display the system’s fully qualified domain name (FQDN)?

a)

hostname --fqdn

b)

dnsdomainname

c)

hostnamectl status

d)

cat /etc/hosts

8.

Which of the following commands can be used to find the location of the passwd binary?

a)

type -a passwd

b)

locate passwd

c)

apropos passwd

d)

whereis passwd

9.

Which of the following commands can be used to view the configuration (man) page for the crontab binary?

a)

man 1 crontab

b)

man 5 crontab

c)

crontab -l

d)

info crontab

10.

In Red Hat Enterprise Linux, which of the following is the preferred tool for registering your system?

a)

subscription-manager

b)

redhat-register

c)

yum register

d)

rhc

11.

What is the name of the AI service included in Red Hat Enterprise Linux?

a)

Lightspeed

b)

AI Engine

c)

RedAI

d)

SmartOps

12.

Which of the following commands can be used to install the AI Command-Line Assistant on RHEL?

a)

yum install command-assistant

b)

dnf install command-line-assistant

c)

rpm -i command-line-assistant

d)

ai-install assistant

13.

Which of the following commands demonstrates piping the output of a command into the AI Command-Line Assistant?

a)

whoami | ai-assist "What does this mean?"

b)

whoami | chat-bot "What does this mean?"

c)

whoami | c chat "What does this mean?"

d)

whoami | assistant-cli "What does this mean?"

14.

Which of the following commands demonstrates attaching a file to the AI Command-Line Assistant and asking a question?

a)

ai-assist -a /var/log/boot.log "Why did the last boot take so long?"

b)

c chat -a /var/log/boot.log "Why did the last boot take so long?"

c)

assistant-cli -a /var/log/boot.log "Why did the last boot take so long?"

d)

chat-bot -a /var/log/boot.log "Why did the last boot take so long?"

15.

Which command can be used to remove a directory and all it's contents?

a)

rmdir ThisDir

b)

rm -r ThirDir

c)

rm ThirDir

d)

unlink ThisDir

16.

Which command will delete a directory and prompt the user before removing it's contents?

a)

rm -r ThisDir

b)

rm -f ThisDir

c)

rm -ri ThisDir

d)

rmdir -i ThisDir

17.

Which of the following commands will create multiple directories while ensuring that the parent directory exists?

a)

mkdir Directory/Study1 Directory/Study2 Directory/Study3

b)

mkdir -p Directory/Study1 Directory/Study2 Directory/Study3

c)

install -d Directory/Study1 Directory/Study2 Directory/Study3

d)

mkdir -r Directory/Study1 Directory/Study2 Directory/Study3

18.

Which of the following commands can be used to recursively list the contents of directories?

a)

ls -LR

b)

ls -lR

c)

ls -d

d)

ls -S

19.

Which description best describes a hard link in Linux filesystems?

a)

A pointer to another file that breaks if the original file is deleted

b)

A separate file that contains a copy of the original file’s contents

c)

A special file that can reference files across different filesystems

d)

An alternate directory entry that refers to the same inode as the original file

20.

Which of the following commands can be used to create a hard link?

a)

ln myStudyNotes.txt myStudyLink

b)

ln -s myStudyNotes.txt myStudyLink

c)

cp myStudyNotes.txt myStudyLink

d)

linkfile myStudyNotes.txt myStudyLink

21.

Which statement best describes a symbolic (soft) link in Linux?

a)

A file that points to another file by name and can span filesystems

b)

An alternate directory entry that refers to the same inode as the original file

c)

A copy of the original file that updates automatically when the original changes

d)

A file that cannot be deleted unless the original file is deleted first

22.

Which of the following commands can be used to visit a symbolic link directory and resolve the directory name to its real path?

a)

cd -p myLink

b)

cd -L myLink

c)

cd myLink

d)

cd -P myLink

23.

Which of the following commands can be used to list all files in a directory that do not start with y?

a)

ls [^y]*

b)

ls !y*

c)

ls [!y]*

d)

ls -v y*

24.

Which of the following commands can be used to efficiently create the directories test1, test2, and test3?

a)

mkdir test[1-3]

b)

mkdir -v test{1..3}

c)

mkdir test?123

d)

mkdir test1 test2 test3

25.

Which of the following commands can be used to list a file called Study when you don’t know its file extension?

a)

ls Study.*

b)

ls Study.???

c)

ls Study?

d)

find . -name "Study"

26.

Which of the following commands can be used to navigate to your previous working directory?

a)

cd ~

b)

cd ?

c)

cd -

d)

cd /

27.

Which of the following commands can be used to find files larger than 10 MB?

a)

find / -size +10M

b)

find / -size 10M

c)

find / -size -10M

d)

find / >10M

28.

Which of the following commands can be used to discard error messages produced by a command?

a)

find / -size +10M > /dev/null

b)

find / -size +10M &> /dev/null

c)

find / -size +10M 2> /dev/null

d)

find / -size +10M | /dev/null

29.

Which of the following commands can be used to separate successful output and error output into two different files?

a)

ls -la &> Successful Unsuccessful

b)

ls -la | Successful 2| Unsuccessful

c)

ls -la > Successful | 2> Unsuccessful

d)

ls -la > Successful 2> Unsuccessful

30.

Which of the following commands will redirect both successful output and error messages into a single file?

a)

find / -size +10M &> Results

b)

find / -size +10M > Results

c)

find / -size +10M 2> Results

d)

find / -size +10M | Results

31.

Which two of the following commands can be used to count the number of files in a directory?

a)

ls -l

b)

ls | wc -l

c)

wc -l *

d)

find . -type f | wc -l

32.

What does the shell redirection operator 2>&1 accomplish when used in a command?

a)

Redirects standard output (stdout) to standard error (stderr)

b)

Redirects standard error (stderr) to the same destination as standard output (stdout)

c)

Redirects both standard output and standard error to a file named 1

d)

Redirects file descriptor 2 to file descriptor 1 only if an error occurs

33.

A system administrator runs a command and wants to see the output on the terminal in real time, while also saving the same output to a file for later review.

Which command should be used to achieve this?

a)

command | tee output.txt

b)

command > output.txt

c)

command 2>&1 > output.txt

d)

command >> output.txt

34.

What is the correct format of an entry in the /etc/passwd file on a modern Red Hat–based system?

a)

username:UID:x:GID:comment:home_directory:login_shell

b)

username:x:GID:UID:comment:home_directory:login_shell

c)

username:password:UID:GID:comment:home_directory:login_shell

d)

username:x:UID:GID:comment:home_directory:login_shell

35.

A system administrator needs to switch to the root user to perform system maintenance. The administrator wants to ensure that root’s full login environment is loaded, including the correct home directory, environment variables, and PATH.

Which command should be used?

a)

su

b)

sudo -s

c)

sudo su

d)

su -l

36.

A system administrator needs to create a system group called TestSystemGroup on a Red Hat Linux system. Which command should be used?

a)

groupadd TestSystemGroup

b)

groupadd -g TestSystemGroup

c)

groupadd -r TestSystemGroup

d)

groupadd -G TestSystemGroup

37.

A system administrator is managing a Red Hat Linux server. The group DevTeam already has some members. The administrator needs to add user1 and user2 to DevTeam without removing any existing group members, using a single command.

Which of the following commands will achieve this?

a)

groupmod -G user1,user2 DevTeam

b)

groupmod -aU user1,user2 DevTeam

c)

usermod -a -G DevTeam user1,user2

d)

groupadd -g DevTeam user1 user2

38.

A system administrator wants to temporarily change his primary group to DevTeam so that any files he creates in the current session belong to that group. Which command allows him to do this?

a)

usermod -g DevTeam

b)

groupmod -g DevTeam

c)

sg DevTeam

d)

newgrp DevTeam

39.

A system administrator needs to update a user’s password policy on a Red Hat Linux system using the chage command. The new policy requires:

  • Minimum password age: 0 days

  • Maximum password age: 120 days

  • Warning period before password expiration: 14 days

  • Account Inactivity period after password expires: 30 days

Which command correctly implements this policy for a user named jdoe?

a)

chage -m 0 -M 120 -w 14 -i 30 jdoe

b)

passwd -n 0 -x 120 -w 14 -i 30 jdoe

c)

usermod -m 0 -M 120 -W 14 -I 30 jdoe

d)

chage -m 0 -M 120 -W 14 -I 30 jdoe

40.

A user is leaving the company, and your manager wants you to lock their account effective on 30 JAN 1999. Which usermod command correctly sets this lockout date for the user jdoe?

a)

usermod -L -e 1999-01-30 jdoe

b)

usermod -L -E 30-01-1999 jdoe

c)

usermod -e 1999-01-30 jdoe

d)

usermod -e 30JAN1999 jdoe

41.

A user account mailSrv01 has been created for a mail server. You want to prevent this account from logging in interactively while keeping it available for system processes. Which usermod command achieves this?

a)

usermod -L mailSrv01

b)

usermod -s /sbin/nologin mailSrv01

c)

usermod -e 1970-01-01 mailSrv01

d)

usermod -p "*" mailSrv01