3.10 操作系统原理 课程(一)

课堂准备

课堂
软件使用:VM(虚拟机)下的Ubuntu20.04
在这里插入图片描述

VM的Ubuntu的常用命令

ctrl alt f6 进入登录用户
在这里插入图片描述

ctrl alt f1 回到图形化界面

课程内容

上节复习

cd …
cd /
cd mnt
ls
ls -l
ls -h
pwd(显示全路径)
cp file1 file2 (copy)
mv file1 file2(move)
rm filename(remove)

快捷命令

Clear screen: clear
Termination: ctrl + c(呼出命令行语句)
Command history: up and down arrows(上下箭头)
Command completion: tab(补全)
ctrl + a(光标定义到命令开头)
ctrl + e(光标定义到命令末尾)

在Linux下编写C程序

方式1 :使用图形化

ctrl out f1 回到图形化界面
搜索 g editor(文本化图形编辑器)
编辑
ctrl +s 保存
在这里插入图片描述
在这里插入图片描述

方式2 :使用命令行模式

(ctrl alt f6 进入登录用户)
vi 进入命令环境
输入i(input),a(append)
删除 x
excp 键 进入
再按 :进入末行,对程序进行一系列保存操作
q
q!(强制退出)
wq(保存退出)

cat hello.c(查看hello.c的内容)

(路径:\wsl.localhost\Ubuntu-18.04\home\qie)
在这里插入图片描述

编译并运行Linux下编写的C程序

在这里插入图片描述
gcc hello.c
ls
a.out(Command not found 注意目录)
./a.out

gcc hello.c -o myhello(重命名)
ls
rm a.out
ls

猜你喜欢

转载自blog.csdn.net/m0_60634555/article/details/129435067