操作系统实验二

一、实验目的:

(1)熟悉Linux系统的基本命令。

(2)熟悉Linux的操作系统。

二、实验环境:

一台装有Linux的机器(这里默认是RedHat Linux 9)

 

三、实验内容:

1.文件操作命令的使用

(1)用vi编辑器新建一个test1文件,并且输入“Thisis test1~!”。

(2)查看文件与目录,具体步骤如下:

进入Linux系统。

输入命令ls -m,并按回车键。

观察结果,结果如图。

 

(3)显示文件内容cat,具体步骤如下:

输入cat test1后,按回车键执行,结果如图。

 

 

(3)删除文件命令rm,具体步骤如下:

登录Linux

在终端输入命令ls

 

按回车键执行命令,如图就可以看到当前目录下的所有文件。rm test1:删除文件test1。

 

 

输入rm test1,按回车键

输入命令ls查看上次执行的结果,如图。

 

 

2.目录命令的使用

(1)cd的使用,具体步骤如下:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
session1 【Objective and Requirement】 Objective: Be familiar with the creation of process and thread on Windows. Requirement: Sub Task 1: Create a console application, "child", which keeps printing out "The child is talking at [system time]" (in a loop, one per 1s). Sub Task 2: Create another console application, "parent". It create a child process to execute “child”. The "parent" process keeps printing out "The parent is talking at [system time]". (one per 1s) Execute "parent" and explain the output you see. Sub Task 3: Create a "winPS" program which can output information about all the running processes. Try to output details about each process, such as PID, executable file name and path, etc. Sub Task 4: In the "mainThread" program, use "CreateThread" to create a child thread. Both the main thread and the child thread keep printing out "[ThreadID] + [System time]". session2 Objective: Create "ps" and "kill" commands on Windows. Requirement: Sub Task 1: On Linux/Unix there are a "ps" command and a "kill" command. The "ps" command can list information about all the running processes. The "kill" command can terminate processes. Based on the tasks finished in Session 1, create "ps" and "kill" commands on Windows. Tips: using "TerminateProcess" to "kill" a process. session3 Objective: Learn how to use semaphore to solve IPC problems. Requirement: Task 3.1. Sleeping barber Use semaphores to solve the problem of sleeping barber. Task 3.2. Reader & Writer Use semaphores to solve the reader and writer problem, with the readers (and writers) have higher priority. session4 Title: Upgrade Linux/Unix commands Problem: Write a program "supershell" that takes another command as an argument and executes that command. For instance, executing: “./supershell cat /usr/greg/readme" would invoke the cat command on the file /usr/greg/readme. After execution of the specified command has completed, "supershell" should display statistics that show some of the system resources the co

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值