Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

LAB 01 – Command line in Linux

Exercise 1:

Exercise 2:

1. Dpkg: là lệnh cơ sở để xử lý các gói Debian trên hệ thống. Nếu bạn có gói .deb, dpkg cho phép
cài đặt hoặc phân tích nội dung của gói đó.

2. Free: Hiển thị dung lượng bộ nhớ RAM còn trống và đang sử dụng.
3. Hostname: là tên được dùng để xác định ra địa chỉ của host trong mạng máy tính.

4. Ifconfig: Hiển thị danh sách các thiết bị mạng trên máy tính. Qua đó, bạn có thể biết được địa
chỉ IP hiện tại của máy.

5. Sudo: Nhiều câu lệnh trong Terminal cần phải có sudo phía trước. Khi dùng sudo, máy tính hiểu
rằng bạn đang thực thi câu lệnh với quyền cao nhất, đó là quyền root.
6. cat /proc/cpuinfo: hiển thị thông số CPU

7. free –m: hiển thị thông số RAM dưới kiểu mebibytes.


8. fdisk –l: liệt kê danh sách phân vùng có sẵn của hệ thống.

Exercise 3:

1. Display your current working directory: pwd

2. Change to new directory /tmp: cd /tmp

3. Go back to HOME directory: cd ~

4. List detail of your directory content (included hidden files): ls –a


5. Do list and redirect the result of the list command on content /usr directory to usr.txt file:

cd /usr

ls | cat>>usr.txt

6. Sort on data input is the usr.txt file in the reverse order: cat usr.txt | sort

7. show content of /usr/bin directory and pause on each screen: ls /usr/bin


8. Search recursive on the /etc directory for all files in which contain ‘log’ word: find –name
\*log\*
9. What is command to count on number of lines in /etc/profile file: wc –l etc

10. How many number of lines in the /etc/profile file: 27

Exercise 4:

You might also like