Professional Documents
Culture Documents
LAB2OSG SE180556 TranQuangHuy
LAB2OSG SE180556 TranQuangHuy
LAB2OSG SE180556 TranQuangHuy
Man -f kill
man ls
Cú pháp:
bg [job_spec]
fg [job_spec]
Mục đích:
bg: Tiếp tục chạy một công việc bị dừng (trong nền).
fg: Đưa một công việc bị dừng trở lại nền trước.
1.3. who
Cú pháp: who
Mục đích: Hiển thị danh sách người dùng hiện đang đăng nhập vào hệ
thống.
Ví dụ:
1.4. chown, chgrp, chmod
Cú pháp:
chown [người_dùng] [tệp/tập_tin]
chgrp [nhóm] [tệp/tập_tin]
chmod [chế_độ] [tệp/tập_tin]
Mục đích:
chown: Thay đổi chủ sở hữu của tệp hoặc thư mục.
chgrp: Thay đổi nhóm sở hữu của tệp hoặc thư mục.
chmod: Thay đổi quyền truy cập của tệp hoặc thư mục.
Ví dụ:
1.5. date
Cú pháp: date [tùy_chọn]
Mục đích: Hiển thị hoặc đặt thời gian và ngày tháng hệ thống.
Ví dụ:
su, top, kill, jobs
Cú pháp:
su [người_dùng]
top
kill [PID]
Jobs
Mục đích:
su: Đổi sang người dùng khác.
top: Hiển thị thông tin hệ thống theo thời gian thực.
kill: Kết thúc một tiến trình.
jobs: Hiển thị danh sách các công việc đang chạy hoặc bị dừng trong nền.
Part 2
The grep command is used to print out the line in the text file that
matches a specified
pattern.
In this context, the file and the pattern are thoca.txt and “thai son”. After
entering the
grep command, it processed the text in thoca.txt line by line to find the
line that have
the string “thai son” in it.
Part 3
The system() function in C is used to pass the commands that can be
executed in the
command processor or the terminal of the operating system. Then, it
executes the
command and finally returns the status of the command, or -1 if there is
an error.