Nguyenxuantruc 1513804 lab1

2 1 0
Nguyenxuantruc 1513804 lab1

Đang tải... (xem toàn văn)

Thông tin tài liệu

Operating System – Linux/Ubuntu Student name Student ID Login 1 What is the HOME directory of your account Commands on directory 2 View the current directory 3 Move to directory /tmp 4 Move to your HO[.]

Operating System – Linux/Ubuntu NGUYỄN XUÂN TRỰC 1513804 Student name: Student ID: Login: /home/mint What is the HOME directory of your account: Commands on directory: pwd View the current directory: cd /tmp Move to directory /tmp: cd /home/mint Move to your HOME directory: Create a directory “lab1” After that create directories “data”, “script”, “temp” as subdirectories of “lab1”: mkdir lab1 mkdir lab1/data mkdir lab1/script mkdir lab1/temp Move to “lab1” and show all file and directories there: cd /home/mint/lab1 ls rm -r temp Delete directory “temp”: Commands on file Move to ~/lab1/data Use “vi” to create a file name “exercise.txt” with the content: ACM International Collegiate Programming Contest (ACM ICPC) [Enter] is the largest computer programming contest in the world [Enter] The ACM ICPC is [Enter] an activity of the ACM [Enter] that provides college students with an opportunity [Enter] to demonstrate and sharpen [Enter] their problem-solving and computing skills [Enter] cat exercise.txt Show the content of “exercise.txt”: cp /etc/passwd /home/mint/lab1/data 10 Copy file /etc/passwd to ~/lab1/data: grep ssh /etc/passwd 11 Show all lines that has the word “ssh” in file /etc/passwd: Hint: using grep 12 What is the owner, group and the access right of file /etc/inittab: mint (read, write) Owner: Group: mint (read) 644 Access right (owner, group, other): 13 The right access of a directory is 751 What is the right access of: read, write, execute Owner: Group: read, execute Others: execute 14 Change the access right of file exercise.txt: owner and group has access right to read, write chmod 664 exercise.txt Others can only read: 15 Move to ~/lab1/data Create files tmp1 and tmp2 (the content is your favorite poem) What is the difference of the two commands:  cp tmp1 tmp2  mv tmp1 tmp2 Cả câu lệnh thực chép liệu từ file tmp1 sang file tmp2 Nhưng lệnh mv tmp1 tmp2 xóa file tmp1 sau chép Trong đó, lệnh cp tmp1 tmp2 giữ lại file tmp1 Using help man -k cat 16 The command the show the usage of the command “cat”: Change direction of input-output cd /usr && ls > usr.txt 17 Show all files and directories in /usr and save the result in file usr.txt: ls -l /usr/bin | more 18 Show all files in /usr/bin and stop when the screen is full: Hint: use command pipe and more grep -ir "log*" /etc 19 Find all files in /etc that the file name contains the word “log”: Hint: use command grep wc -l /etc/profile 20 How many lines in the file /etc/profile? Hint: use wc -l

Ngày đăng: 11/04/2023, 16:03