Shell Scripting Basics Quiz

SupportingPluto avatar
SupportingPluto
·
·
Download

Start Quiz

Study Flashcards

24 Questions

What is the purpose of executing the command 'chmod u+x Emp1.sh'?

To change the mode of the user to executable

What does the command './Emp1' do?

Executes the Emp1 script

What does it indicate if a string size is greater than 20?

The string is not empty

In Linux, what does it mean when a file has 'rwx' permissions?

The file is readable, writable, and executable

What does the condition '5 is not greater than 2' evaluate to?

False

What does the command 'ls' do in Linux?

Lists all files and directories in the current directory

How can you indicate that a file is a shell script?

Change mode to executable./Script.sh

What command will print only the names of current users?

Print only names of current users

How would you wait for the user to input data from the keyboard in a shell script?

Print please type a line

What is the condition to successfully execute cmd2 after ensuring that hello.txt exists?

If hello.txt exist it will successfully execute otherwise fail

How would you indicate the end of an if statement in a shell script?

Indicate the end of if statement

What construct in shell scripting is similar to 'elseif' in C++?

Nested if statement

How can a file be indicated as a shell script?

Setting the executable mode using 'chmod +x'

What will be printed after successfully removing all files in the current directory?

All files successfully removed

How can the end of an if statement be indicated in a shell script?

Using 'fi'

What does the command 'ls' do in Linux?

List all files and directories

What construct in shell scripting is similar to 'elseif' in C++?

'elif'

In a shell script, what does the condition '5 is not greater than 2' evaluate to?

True

In shell scripting, what is the purpose of the command 'chmod u+x Emp1.sh' followed by './Emp1'?

To change the file permissions to allow the file owner to execute the script, and then execute the script

If a string size is greater than 20 characters in shell scripting, what will be the result of evaluating the expression '5 is not greater than 2'?

True

When using a conditional statement in shell scripting, what construct is similar to 'switch' in C++?

case

What does it indicate if a string is not empty in shell scripting?

The string contains at least one character

When executing a shell script using './Emp1', what does the './' represent?

The current directory

What is the purpose of printing numbers from 0 to 9 in shell scripting?

To demonstrate looping and iteration

Test your knowledge of shell scripting basics with this quiz. Questions cover topics such as printing today's date, displaying login shell, listing current users, changing file permissions, and user input handling.

Make Your Own Quizzes and Flashcards

Convert your notes into interactive study material.

Get started for free

More Quizzes Like This

Linux Bash Scripting Quiz
61 questions

Linux Bash Scripting Quiz

ColorfulCatharsis avatar
ColorfulCatharsis
CEST-CE Term_2 GNU/LINUX (Week 6)
40 questions
Use Quizgecko on...
Browser
Browser