BSIT3201-Finals

BSIT3201-Finals

University

50 Qs

quiz-placeholder

Similar activities

KELAS 2-REVIEW MATERI INFORMATIKA SM2

KELAS 2-REVIEW MATERI INFORMATIKA SM2

2nd Grade - University

50 Qs

IT2112 Networking 1 Quiz 1

IT2112 Networking 1 Quiz 1

University

45 Qs

PRELIM EXAM_INTERNET RESEARCH FOR BUSINESS

PRELIM EXAM_INTERNET RESEARCH FOR BUSINESS

University

55 Qs

CompTIA Security+ SY0-701 Revision Test 1

CompTIA Security+ SY0-701 Revision Test 1

University

50 Qs

Кәсіби ағылшын 201 - 250

Кәсіби ағылшын 201 - 250

University

50 Qs

Cybersecurity Quiz

Cybersecurity Quiz

University

50 Qs

IAS1-FINAL EXAMINATION

IAS1-FINAL EXAMINATION

University

50 Qs

UAS TIK KELAS VII GANJIL 2024/2025

UAS TIK KELAS VII GANJIL 2024/2025

7th Grade - University

50 Qs

BSIT3201-Finals

BSIT3201-Finals

Assessment

Quiz

Information Technology (IT)

University

Hard

Created by

Ardi Moran

Used 2+ times

FREE Resource

50 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. Which of the following best explains why using #!/bin/bash at the beginning of a script is important?

It makes the script executable.

It defines the location of the shell to execute the script.

It comments out the second and last line of the executable script

It sets the default permissions of the file in bash scriptng

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. You are writing a script to check disk space. Which command combination is most effective for storing and analyzing the used disk percentage?

ls | grep

df -h | awk '{print $5}'

du -h | head -1

ps aux | sort

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. Which statement is true regarding variables in shell scripting?

All variables must be declared with var int.

Variables are declared with a dollar sign $ prefix.

Variable values are assigned using = without spaces.

All variables are automatically global.

Answer explanation

Shell variable syntax requires no space before or after the =.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image
  1. What will the following script output?
    bash

  2. x=5
    y=10

    echo $((x+y))

x+y

15

5+10

Error

Answer explanation

The $(( )) evaluates arithmetic expressions.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. Why is chmod +x script.sh necessary before executing a script directly?

It changes the owner of the script.

It adds write permissions to the script.

It allows the script to be executed.

It creates a backup of the script.

Answer explanation

The +x flag gives execute permission.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A system admin wants to create a backup script that copies all .conf files from /etc to /backup and logs the time of backup.
Which of the following commands is most appropriate in the script?

cp /etc/*.conf /backup && date >> log.txt

mv /etc/*.conf /backup && time >> log.txt

cat /etc/*.conf > /backup && echo $date >> log.txt

ls /etc/*.conf | cp /backup && echo date >> log.txt

Answer explanation

This line copies .conf files and logs the date after a successful operation.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image
  1. You wrote a script with this snippet:

What would happen if the user entered a non-numeric input like "abc"?

The script prints "Low".

It compares text and prints "High".

It shows a syntax error.

It crashes with an error message.

Answer explanation

Non-numeric input will cause [ $num -gt 10 ] to fail, leading to an error

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?

Discover more resources for Information Technology (IT)