KIỂM TRA GIỮA KÌ
Linux and Open Source Sysstem Course
Question 1 (3 pts): Terminal
Open your virtual machine and capture your ubuntu desktop screen. Then open terminal, capture your terminal screen.
What is terminal?
A terminal is a "physical" (direct) interface to your Linux Operating System.
A terminal is a text input and output environment. It is a program that acts as a wrapper and allows us to enter commands that the computer processes.
In plain English again, it's the "window" in which you enter the actual commands your computer will process.
What are the benefits of using terminal?
The first reason is that for many tasks, it's just more efficient.
The second reason is that by using commands can easily automate tasks.
The third reason is that sometimes the CLI will be the only way in which we'll be able to interact with a computer.
The last reason is it looks cool and it's fun.
Explain what is the text shown before $ in your terminal?
The $ sign before the variable name is interpreted by the system as a variable.
The name of user and the name of virtual machine login to the terminal
What are the differences between these paths: /, ./, ../, ~
using “/” at the start of your path means “starting from the root directory”. Using the tilde character (”~”) at the start of your path similarly means “starting from my home directory”.
Run the commands and capture the terminal screen to show:
who is logging to the terminal: thuylinh
your current location: /home/thuylinh19
list all of files, directories in that shows all of files including hidden files. What are your hidden files in ~
Question 2 (3 pts): Files Directories and Basic Scripts
Create a directories structure
Create a shell script file name: answer.sh in folder test_2b
> It can get two parameters $1 and $2 when running answer.sh
> It then can print “This is the answer of $1 is $2”
> Capture the source code of by command $cat answer.sh and run it with two parameters: 2b and your student ID
Capture the screen and explain the access permission of the file answer.sh
File " answer.sh " owned by user "thuylinh19"
The file owner can read, write, and execute the file.
All others can read and execute the file.
File owned by group " thuylinh19"
Change access permission of the answer.sh to 000. Explain why we cannot run the program and how can we run this file without permission?
Because change to 000 we will loss all permission and User do not have any permission to access this file.
Question 3 (2.5 pts): Write a shell script calculator.sh in Question 3
Question 4 (1.5 pts): Users and Groups
Create a new group midterm and add your user to group midterm
Run command to show your name in /etc/passwd using grep. What is your User ID and Group ID, location of your home directory, what is the User ID of root?
Write a shell script in Question 4
Program can print out /etc/shadow and show just your name result using grep
Chia sẻ với bạn bè của bạn: |