quiz image

Understanding Shell Path Variable Quiz

LawAbidingCommonsense avatar
LawAbidingCommonsense
·
·
Download

Start Quiz

Study Flashcards

18 Questions

Which command adds the new user 'tux' and creates the user's home directory with default configuration files?

useradd -m tux

What information is stored in the /etc/passwd file?

The encrypted password and the user's default shell

Which of the following tar options handle compression?

-j and -z

What keyword is used in a shell script to begin a loop?

for

Which of the following commands creates an archive file work.tar from the contents of the directory ./work/?

tar -cf work.tar ./work/

Which of the following permissions does CertyIQ r=read w=write x=execute t = means?

The file can be deleted only by the owner or root user

What is the purpose of setting a variable in Shell scripting?

To allow the execution of commands without knowing the executable location

Which command can be used to set the variable USERNAME to 'bob' in Shell scripting?

set USERNAME bob

In Shell scripting, what does the operator '?' do in a regular expression?

Matches the preceding character zero or one time

Which command should be used in a script to display the content of a variable MYVAR in Shell scripting?

$MYVAR

What issue arises when executing the given script 'script.sh' with 'MYVAR=value ./script.sh'?

The script does not display the content of MYVAR

Which special character is used for wildcard matching in Linux commands?

What will the command ls ../ Documents/ do if executed in the /home/user/Downloads/ directory?

List the contents of the /home/user/Documents/ directory

Which command will copy all files ending with .txt to the /tmp/ directory?

cp *.txt /tmp/

How can you split a long command across multiple lines in the shell?

Use the \ backslash character at the end of each line

Which command would move all files starting with text and ending with .csv to a new directory called data?

mv text*.csv data/

What is the purpose of the chmod command?

Change the permissions (read, write, execute) of a file or directory

Which command would list all files in the current directory, including hidden files?

ls -a

Test your knowledge on shell path variables with this quiz. Questions cover topics such as the execution of commands without knowing the location of the executable and the indication of the default shell to be used when a user logs in.

Make Your Own Quizzes and Flashcards

Convert your notes into interactive study material.

Get started for free

More Quizzes Like This

Shell Pattern Matching Quiz
5 questions
Shell Scripting Basics
15 questions

Shell Scripting Basics

HallowedMajesty avatar
HallowedMajesty
Shell Command Output Redirection
12 questions
Shell-Light Structure Architecture
39 questions
Use Quizgecko on...
Browser
Browser