Kiểm tra giữa kì Linux and Open Source Sysstem Course Question 1 (3 pts)



tải về 1.1 Mb.
Chuyển đổi dữ liệu20.10.2022
Kích1.1 Mb.
#53616
20IT977 LÊ-THỊ-THÙY-LINH Midterm (1)


KIỂM TRA GIỮA KÌ
Linux and Open Source Sysstem Course
Question 1 (3 pts): Terminal

  1. Open your virtual machine and capture your ubuntu desktop screen. Then open terminal, capture your terminal screen.



  1. 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.

  1. 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.

  1. 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

  1. 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”.

  1. 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

  1. Create a directories structure



  1. 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

  1. 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"



  1. 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

    1. Create a new group midterm and add your user to group midterm



  1. 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?



  1. Write a shell script in Question 4



  • Program can print out /etc/shadow and show just your name result using grep

tải về 1.1 Mb.

Chia sẻ với bạn bè của bạn:




Cơ sở dữ liệu được bảo vệ bởi bản quyền ©hocday.com 2024
được sử dụng cho việc quản lý

    Quê hương